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.
Steven noyes
source share