Skip to content

Commit

Permalink
ekf2: gravity fusion don't use any accel samples that are clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Aug 28, 2023
1 parent 2c76109 commit 0f260fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/ekf2/EKF/gravity_fusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ void Ekf::controlGravityFusion(const imuSample &imu)

_aid_src_gravity.fusion_enabled = _control_status.flags.gravity_vector;

if (_aid_src_gravity.fusion_enabled && !_aid_src_gravity.innovation_rejected) {
const bool accel_clipping = imu.delta_vel_clipping[0] || imu.delta_vel_clipping[1] || imu.delta_vel_clipping[2];

if (_aid_src_gravity.fusion_enabled && !_aid_src_gravity.innovation_rejected && !accel_clipping) {
// perform fusion for each axis
_aid_src_gravity.fused = measurementUpdate(Kx, innovation_variance(0), innovation(0))
&& measurementUpdate(Ky, innovation_variance(1), innovation(1))
Expand Down

0 comments on commit 0f260fc

Please sign in to comment.