Skip to content

Commit

Permalink
ekf2-gravity: do not estimate accel bias when gravity fusion is active
Browse files Browse the repository at this point in the history
Gravity fusion uses the bias corrected accelerometer data to correct the
tilt estimate. We should not continue to estimate the accel bias when
this is active as it creates an unwanted feedback loop.
  • Loading branch information
bresch committed Jan 23, 2025
1 parent beb7e7d commit b1b6810
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/ekf2/EKF/ekf_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,8 @@ void Ekf::updateIMUBiasInhibit(const imuSample &imu_delayed)
} else if (_control_status.flags.fake_hgt) {
is_bias_observable = false;

} else if (_control_status.flags.fake_pos) {
// when using fake position (but not fake height) only consider an accel bias observable if aligned with the gravity vector
} else if (_control_status.flags.fake_pos || _control_status.flags.gravity_vector) {
// only consider an accel bias observable if aligned with the gravity vector
is_bias_observable = (fabsf(_R_to_earth(2, index)) > 0.966f); // cos 15 degrees ~= 0.966
}

Expand Down

0 comments on commit b1b6810

Please sign in to comment.