Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between gyroscope rotation data and device motion rotation data?

It could be a simple question to most of you. But, I couldn't figure out the difference between gyroscope rotation data and device motion rotation data.

My problem :

If user tilt the IOS device in particular axis(for Ex: X-axis), Then, I have to modify frame.origin.x property of UIImageView based on the tilt operation result. Same as for the Y-axis.

My questions :

Whether should i use gyroscope rotation data or device motion rotation data for better result ?

I happened to read the documentation from Apple and it said gyroscope is biased one. What does it mean?

I want to calculate the difference between two rotation data in terms of pixels? How can i do it?

Thanks for you answers.

like image 950
Kirubachari Avatar asked Jan 26 '26 21:01

Kirubachari


1 Answers

Device motion api use gyroscope and accelerometer to build motion matrix to all directions. Gyro is the difference of orientation from reference to current.

You need to store two matrixes from api in two moment of time and calculate diff of axis you need. If you need transform rotation to on-screen move you have to calculate it using difference of matrixes. iOS api have same helpful functions relative to CGAffineTransform.

like image 81
PRu Avatar answered Jan 29 '26 10:01

PRu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!