IPhone Compass Presents Incorrect Title Pitch Angle> About 45 °

It can be difficult to explain geometry, so I will be careful in writing it. This can be seen in the standard compas application and from the data in the CLLocationManager.

1) When holding the phone in portrait orientation, consider a pitch angle of 0 °

2) When pointing the camera at the sky (for example, shooting a cloud), the pitch angle changes from 0 ° to 90 °, where 90 degrees straight up.

3) when the phone is tilted up (> 0 degrees and rotates on the axis of the magnetometer "X"), and when the phone is approximately (but not exactly) 45 degrees, the compass course rotates 180 degrees. Therefore, while the camera still indicates ā€œN,ā€ the compass will report ā€œSā€.

4) for the next (approximately) 90 degrees, the compass heading rotates 180 degrees.

This rotation of the header is destructive for me, and it does not fit perfectly with accelerometers. Is there a good tutorial (I didn't find it with a bat) when using RAW data (X, Y, Z) from CLHeading data to calculate header data?

As a result, I want the compass heading to always match the camera heading.

+7
source share
1 answer

You cannot rely solely on the compass heading. See this answer for what you are looking for, and in particular the yaw property of the CMAttitude object, to compensate for the pitch angle that you are talking about: Compensating compass delay using a gyro on iPhone 4

+2
source

All Articles