I've been testing sensor data on Android and I noticed weird behavior when phones screen is pointing toward gravity (upside-down). When I obtained data from TYPE_ORIENTATION sensor azimuth is having wrong values and minor shifts causes major changes. Is it somehow related with Euler's rotation representation and numerical singularity? Is there any workaround to have correct compass azimuth values even though phone is upside down?

有帮助吗?

解决方案

It looks like this is a normal behaviour and is related to the last z-axis component called magnetic inclination. x-axis component is what typical compass shows and point toward the north pole. X and Y components are much smaller than Z component that's why when device is rotated this component is projected to device x and y-axis yielding wrong results.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top