Can anyone help on removing the g factor from accelerometer readings?
I am using SensorEventListener with onSensorChanged() method for getting Sensor.TY
onSensorChanged()
Just subtract out g (~9.8m/s^2) times the z direction of the rotation matrix. Or to be more explicit about it, let
a = your accelerometer reading, R = your rotation matrix (as a 9-long vector).
Then what you want is
(a[0]-g*R[6], a[1]-g*R[7], a[2]-g*R[8]).