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 yaw variance initialization #21936

Merged
merged 5 commits into from
Aug 8, 2023
Merged

EKF2: fix yaw variance initialization #21936

merged 5 commits into from
Aug 8, 2023

Conversation

bresch
Copy link
Member

@bresch bresch commented Aug 7, 2023

Solved Problem

By checking the yaw variance (error around the Down axis in local frame) before and after a yaw reset I realized that something was incorrect. For example I was getting this (from the pitch90 initialization unit test):
increase yaw var by 0.090000: 0.000335 -> 0.010335

Solution

Use SymForce to compute the equivalent quaternion variance from some yaw variance defined in NED
Now:
increase yaw var by 0.090000: 0.000340 -> 0.090340

Changelog Entry

For release notes:

Fix yaw uncertainty initialization
New parameter: -
Documentation: -

Test coverage

  • unit test

P(3,1) -= yaw_variance*SQ[1]*SQ[3];
P(3,2) -= yaw_variance*SQ[0]*SQ[3];
matrix::SquareMatrix<float, 4> q_variance;
sym::YawVarToQuatVar(getStateAtFusionHorizonAsVector(), yaw_variance, &q_variance);
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick, maybe we should know from the signature we're only getting the lower triangle populated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Base automatically changed from pr-ekf2-rot-var to main August 7, 2023 18:28
@bresch
Copy link
Member Author

bresch commented Aug 8, 2023

I'll also update the tilt covariance initialization auto-code soon (in another PR)

@bresch bresch requested a review from dagar August 8, 2023 09:13
@dagar dagar merged commit 1f02d55 into main Aug 8, 2023
85 of 86 checks passed
@dagar dagar deleted the pr-ekf2-yaw-var branch August 8, 2023 16:09
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.

None yet

2 participants