General Gravity

Calibrating gravity and magnetic field sensor

userHead HumeleJotesane 2022-11-16 14:28:01 441 Views0 Replies

I'm using an Android 7.0 phone (Huawei P9 Plus) and I'm recording sensor data.

The recordings of the gravity sensor (Sensor.TYPE_GRAVITY) show always unreliable accuracy (using SensorEvent.accuracy). Is there a possibility to calibrate the gravity sensor?

For the magnetic field sensor (Sensor.TYPE_MAGNETIC_FIELD) I'm getting in the beginning also unreliable accuracy but after moving the phone a bit around it first changes to low accuracy, then to medium accuracy and then to high accuracy. Why is that? Can it not be all the time at high accuracy, also right from the start?