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

1.4k views Asked by At

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.

2

There are 2 answers

0
PRu On

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.

0
gabriel On

Maybe these Url's could be useful: Gyroscope and Using Core Motion