Android compass: different Azimuth values depending on Pitch

676 Views Asked by At

I'm developing an app and I need to use camera and compass simultaneously. The problem is that the value of Azimuth changes depending on the one of Pitch (in other words if I'm holding the phone or I put it on the table), and It seems like there's mathematical correlation between the two values: pointing at 180° there are no differences... otherwise there is a gap of even 20-30°.

I've implemented the compass both using Sensor.TYPE_ORIENTATION and the combination of Sensor.TYPE_ACCELERATION + Sensor.TYPE_MAGNETIC_FIELD but nothing has changed.

NOTE: I'm talking about the Pitch, not the Roll. Obviously if a turn left or right the phone I have to adjust the result with +-90°.

I'm using an LG P500 (Optimus One) for the tests. Is that a problem of my device? Or am I missing something?

Thanks.


edit: found out someone else has already asked the same question... still unsolved https://stackoverflow.com/questions/10224951/android-compass-in-extreme-circumstances

0

There are 0 best solutions below