-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Conversation
src/modules/ekf2/EKF/ekf_helper.cpp
Outdated
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I'll also update the tilt covariance initialization auto-code soon (in another PR) |
change caused by fixing the yaw variance increase calculation
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:
Test coverage