How to remove Gravity factor from Accelerometer readings in Android 3-axis accelerometer

后端 未结 7 1558
天命终不由人
天命终不由人 2020-12-29 08:16

Can anyone help on removing the g factor from accelerometer readings?

I am using SensorEventListener with onSensorChanged() method for getting Sensor.TY

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 08:47

    One way (for devices only with accelerometer) is to remove gravity vector from accelerometer data by subtracting the values that would come in static case for same orientation. But as orientation is again calculated by taking acceleration readings and not independently, its not very accurate.

    Gyroscope may help in this case. But few androids still have a true gyroscope. And using its raw readings is not so simple.

提交回复
热议问题