Gravity Compensation in Accelerometer Data

后端 未结 2 1021
醉话见心
醉话见心 2020-12-14 13:05

Given an Accelerometer with 9 DOF (Accelerometer, Gyroscope and Magnetometer) I want to remove/compensate the effect of the gravity in accelerometer reading (Accelerometer c

2条回答
  •  萌比男神i
    2020-12-14 13:58

    I assume your accelerometer reading is in sensor body frame. First we need to represent accelerometer data with respect to inertial frame, and then subtract gravity. If you are directly using Euler angles rather than quaternion, then you need to compute rotation matrix

    R = [
        ctheta*cpsi,
        -cphi*spsi + sphi*stheta*cpsi,
        sphi*spsi + cphi*stheta*cpsi;
        ctheta*spsi, cphi*cpsi + sphi*stheta*spsi,
        -sphi*cpsi + cphi*stheta*spsi;
        -stheta, sphi*ctheta, cphi*ctheta
    ]
    

    (It's given with MATLAB notation). Here phi stands for roll angle, theta for pitch, and psi for yaw. This R matrix is from body to inertial frame. I think in flight dynamics it's also known as transpose of Direction Cosine Matrix (DCM).

    When you apply matrix multiplication operation, now you need to subtract gravity from z direction in order to eliminate static acceleration, i.e., gravity.

提交回复
热议问题