Preintegrated IMU - Gravity vs Acceleration Bias?

468 views
Skip to first unread message

Harry

unread,
Jul 17, 2023, 6:39:42 PM7/17/23
to gtsam users
Hello,

I am using the PreintegratedCombinedMeasurements as part of a larger factor graph and wish to verify everything before moving on to other (non-IMU) factors. I'm constraining my problem to testing just the state estimate (starting from zero) attempting to verify everything is functioning prior to incorporating it into the graph. I have it set up such that I am asking the PreintegratedCombinedMeasurements object for a prediction (NavState) after some X amount of IMU measurements. 

I have it set up in two scenarios:
1) I set gravity_vector to [0.0, 0.0, -9.81] and leave the acc_bias and gyro bias to [0.0, 0.0, 0.0]

2) I set gravity_vector to [0.0, 0.0, 0.0] and set acc_bias to [0.0, 0.0, 9.81] (otherwise acceleration accumulates in the Z dimension rather than subtracts) and gyro bias to [0.0, 0.0, 0.0]

Based on my current understanding, I would expect that these two scenarios both yield the same result given the same input IMU messages. However, what I get are the two images below. 

Is my expectation that these two scenarios yield identical results flawed? If so, can anyone explain how the gravity vector and the accelerometer bias are treated differently in the PIM prediction methods please?

Thanks!


NOTE: In the attached images, the red is showing our ground truth odometry (for comparison) while the green is showing our PIM predicted state every N messages (without reset). In both scenarios the PIM is initialized with zero velocity and at the same pose as the ground truth odometry starting pose.

pim_with_bias_but_zero_gravity_vec.png
pim_with_gravity_vec_but_zero_bias.png

Russell Buchanan

unread,
Jul 18, 2023, 7:15:56 AM7/18/23
to gtsam users
Is this simulated data of a perfect IMU which is kept at constant orientation with respect to the gravity vector?
Generally, you should not expect them to be the same because the IMU biases are in the IMU reference frame while gravity is in the global frame. Imagine if you pitch forward the IMU by 45 degrees. Gravity should now be affecting two axes but if you set it to have zero gravity and Z bias of 9.81 then will only affect the Z axis.

Harry

unread,
Jul 19, 2023, 9:36:14 AM7/19/23
to gtsam users
Thanks Russell! That makes perfect sense.
Reply all
Reply to author
Forward
0 new messages