How to remove the gravity from accelerometer

The so called "linear acceleration" is calculated by subtracting the predicted value of the gravity vector from the total acceleration.

In turn the predicted value of gravity is obtained by transforming the world frame vector [0 0 1] into the body frame, which requires a full 3D orientation matrix or quaternion.

Doing so won't do you much good with consumer grade sensors, because the estimated 3D orientation is too inaccurate, as discussed here: Library | CH Robotics

1 Like