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

Conversation

bresch
Copy link
Member

@bresch bresch commented Nov 15, 2022

Describe problem solved by this pull request

Some people are still seeing annoying "height estimate not stable" messages primarily because the GNSS altitude drifted by a couple of meters after initializing the EKF origin. The problem is that with Zero Velocity Updates in addition to GNSS velocity fusion, the variance of the velocity estimate becomes really small and makes the position estimate too rigid and it can take several tens of seconds to move by a couple of meters.

Describe your solution

  1. Do not fuse zero velocity fake measurements if another velocity aiding source is active (GNSS or VIO)
  2. Use "extremely high accuracy" during fine alignment and "good accuracy" otherwise (this is to decouple from _NED_origin_initialised that relates to GNSS directly)

Test data / coverage

Unit tests, SITL

@bresch bresch added the EKF2 label Nov 15, 2022
@bresch bresch requested a review from dagar November 15, 2022 15:25
@bresch bresch self-assigned this Nov 15, 2022
@bresch bresch marked this pull request as ready for review November 15, 2022 15:26
@@ -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

@dagar dagar merged commit 22420a7 into main Nov 15, 2022
@dagar dagar deleted the pr-ekf2-relax-zvu branch November 15, 2022 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants