android remove gravity from accelerometer readings
问题 I am developing an application for Android where I need to remove gravity from accelerometer readings. I have read multiple discussions on this problem, I have also found an algorithm here, but I didn't really understand it. I want to filter gravity from each axis, not from the total acceleration. Could you please help me out? My code should be something like: public void onSensorChanged(SensorEvent sensorEvent) { float vals[] = sensorEvent.values; float accelerationX = filterGravity(vals[0])