Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

EKF covariance prediction stability improvements #1026

Merged
merged 6 commits into from
Jul 13, 2021

Conversation

bresch
Copy link
Member

@bresch bresch commented Jul 13, 2021

Issue

A recent unit test I created to replicate a real-life issue (#1022) revealed a weakness in the covariance prediction code, creating correlation between physically decoupled states.

The fix

By incorporating the unit quaternion constraint in the quat2Rot conversion, the covariance prediction gets more stable and avoids having correlation between states that should be absolutely separated in practice (e.g. Z gyro bias -> Z accel bias).

This was most likely the main cause of the accel bias divergence we've seen in EKF2.

The generated code for the aiding sources (fusions) is also slightly different but I will update them later as most of the issues were apparently due to the covariance prediction and seems to be fixed now.

SITL tests showed that IMU biases are now really well estimated.
DeepinScreenshot_select-area_20210709164507

Furthermore, it seems that the heading converges much faster than before in mag-less operation during accelerations of the vehicle.

DeepinScreenshot_select-area_20210709164240

@bresch bresch force-pushed the ekf-derivation-cov-fix-upstream branch from 961fe1c to e1a42ea Compare July 13, 2021 08:30
Copy link
Collaborator

@priseborough priseborough left a comment

Choose a reason for hiding this comment

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

I've independently generated the auto-code, imported it and diffed against this PR. Also this derivation change has solved replay of a problem log showing bad covariance conditioning in the ardupilot EKF3 that uses the same math.

@bresch bresch merged commit 8a0510d into master Jul 13, 2021
@bresch bresch deleted the ekf-derivation-cov-fix-upstream branch July 13, 2021 08:49
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Nice find!! 👍
I wouldn't have thought this makes a difference when you use it in a symbolic context.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants