Subtracts the rotated gravity vector from raw accelerometer data,
leaving only dynamic (linear) acceleration. The gravity direction
is determined by rotating the reference gravity vector (0, 0, -g)
from the world frame into the sensor frame using the provided
orientation quaternions.
Arguments
- accel
Numeric matrix (n x 3) of raw accelerometer readings in m/s^2.
- orientation
A data.frame or matrix containing orientation quaternions. If a data.frame, must contain columns
q_w,q_x,q_y,q_z(as returned byestimateOrientation()). If a matrix, must have 4 columns (w, x, y, z).- g
Numeric. Gravitational acceleration magnitude (default 9.81 m/s^2).
Details
For each time step, the gravity vector in the world frame
(0, 0, -g) is rotated into the sensor frame using the conjugate
of the orientation quaternion. This rotated gravity is then
subtracted from the raw accelerometer reading.