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: fix offset from height reference after resets #23491

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

bresch
Copy link
Member

@bresch bresch commented Aug 5, 2024

Solved Problem

When several height sensors are failing at the same time, the EKF resets to the first available measurement. If the height is reset to a secondary height source, this leads to a bias buildup of the height reference.

Solution

Only allow the primary height source to perform a height reset. A secondary height source can only stop and restart (and automatically adjust its own bias to match the current height estimate).

Test coverage

covered by new unit tests

@bresch bresch added the EKF2 label Aug 5, 2024
@bresch bresch requested review from dagar and haumarco August 5, 2024 10:08
@bresch bresch self-assigned this Aug 5, 2024
@dagar
Copy link
Member

dagar commented Aug 5, 2024

Looks good, but shouldn't we also simplify the reset for each case? We no longer have to fumble with the bias.

resetVerticalPositionTo(measurement - bias_est.getBias(), measurement_var);
bias_est.setBias(-_state.pos(2) + measurement);

@bresch
Copy link
Member Author

bresch commented Aug 6, 2024

Looks good, but shouldn't we also simplify the reset for each case? We no longer have to fumble with the bias.

Yes, we can probably simplify the logic a bit, I'll do that in a follow-up PR. That one is just an immediate fix.

@dagar dagar merged commit d2478d0 into main Aug 6, 2024
91 of 95 checks passed
@dagar dagar deleted the pr-ekf2-hgt-ref-reset branch August 6, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants