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 joseph covariance update for Schmidt-Kalman filter #22847

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

bresch
Copy link
Member

@bresch bresch commented Mar 6, 2024

If part of the Kalman gain is zeroed, the first step of the joseph update does not produce a symmetrical matrix.

I was playing with the mag 3D fusion and a different error-state formulation and managed to make the ekf diverge (really hard to trigger, I've only seen it once. Luckily logging from boot was enabled).
https://logs.px4.io/plot_app?log=75f6a8a5-d47a-47ac-a48a-bf2d846ba501

After replaying on main I saw that the issue was real:
Screenshot from 2024-03-06 17-30-43

With this PR it no longer diverges:
Screenshot from 2024-03-06 17-30-58

Changelog Entry

For release notes:

EKF2: fix joseph covariance update for Schmidt-Kalman filter
New parameter: -
Documentation: -

Test coverage

replay

Context

Related links, screenshot before/after, video

@bresch bresch added the EKF2 label Mar 6, 2024
@bresch bresch requested a review from dagar March 6, 2024 16:37
@bresch bresch self-assigned this Mar 6, 2024
src/modules/ekf2/EKF/ekf.h Outdated Show resolved Hide resolved
@bresch bresch force-pushed the pr-ekf2-joseph-schmidt-kalman branch 3 times, most recently from b6ef12f to 6af786f Compare March 7, 2024 12:09
bresch added 2 commits March 7, 2024 13:13
If part of the Kalman gain is zeroed, the first step of the joseph
update does not produce a symmetrical matrix.
@bresch bresch force-pushed the pr-ekf2-joseph-schmidt-kalman branch from 6af786f to 8c4e6a4 Compare March 7, 2024 12:13
@bresch bresch merged commit 2bacb4b into main Mar 7, 2024
91 of 92 checks passed
@bresch bresch deleted the pr-ekf2-joseph-schmidt-kalman branch March 7, 2024 14:11
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