Skip to content

Commit

Permalink
ekf2: do not fuse ZVU if other velocity source is active
Browse files Browse the repository at this point in the history
  • Loading branch information
bresch authored and dagar committed Nov 15, 2022
1 parent c67f03f commit 22420a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/ekf2/EKF/zero_velocity_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ void Ekf::controlZeroVelocityUpdate()

if (zero_velocity_update_data_ready) {
const bool continuing_conditions_passing = _control_status.flags.vehicle_at_rest
&& _control_status_prev.flags.vehicle_at_rest;
&& _control_status_prev.flags.vehicle_at_rest
&& !isVerticalVelocityAidingActive(); // otherwise the filter is "too rigid" to follow a position drift

if (continuing_conditions_passing) {
Vector3f vel_obs{0, 0, 0};
Vector3f innovation = _state.vel - vel_obs;

// Set a low variance initially for faster accel bias learning and higher
// Set a low variance initially for faster leveling and higher
// later to let the states follow the measurements
const float obs_var = _NED_origin_initialised ? sq(0.2f) : sq(0.001f);
const float obs_var = _control_status.flags.tilt_align ? sq(0.2f) : sq(0.001f);
Vector3f innov_var{
P(4, 4) + obs_var,
P(5, 5) + obs_var,
Expand Down

0 comments on commit 22420a7

Please sign in to comment.