Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ekf2: do not fuse ZVU if other velocity source is active #20611

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just skipping vz fuse below if vertical velocity aiding active? ~ line 65

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only sources of velocity are VIO and GNSS and when active they're fusing a 3D vector so isVerticalVelocityAidingActive is the same as "is velocity aiding active" (maybe I should make a function that makes this obvious). I think that the same logic should apply on the horizontal axes, this is why I implemented it that way


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