iOS Gyroscope normalization

140 Views Asked by At

I have to write here the question because I could not find the answer anywhere. My math level is not good, I can do but I have difficulties. My problem is sort of simple:

Im developing an app that show pitch/yaw/roll, so I began to use the Core Motion framework. My problem is that I have to display the 3 axis of the phone x/y/z as 0/0/0 (like you have it flat on a table) when the user start to see that view; so if the user is holding the phone vertically and slightly toward the right, I need to see the pitch as 0 and roll as 0. I see that attitude for pitch and roll, when starting the sensor, don't display 0 like yaw, but they give you the reference of the device in that moment to the floor. I saw many complex math formulas to normalize the vector, but is any simple way to get that value as 0 since the begin of the recording?

Thanks

0

There are 0 best solutions below