EKF: Rework quaternion yaw reset.

Use a new method that preserves the roll and pitch information and adds the uncertainty for yaw only.
Ensure that correlation information to non-quaternion states is removed when a reset occurs to prevent fusion of subsequent observations (e.g. GPS) causing incorrect yaw.
This commit is contained in:
Paul Riseborough
2019-01-31 09:53:57 -05:00
committed by Daniel Agar
parent fc2a089823
commit ef5a87c1d4
3 changed files with 13 additions and 30 deletions
+4
View File
@@ -215,6 +215,10 @@ void Ekf::controlExternalVisionFusion()
// calculate initial quaternion states for the ekf
_state.quat_nominal = Quatf(euler_init);
uncorrelateQuatStates();
// adjust the quaternion covariances estimated yaw error
increaseQuatYawErrVariance(sq(fmaxf(_ev_sample_delayed.angErr, 1.0e-2f)));
// calculate the amount that the quaternion has changed by
_state_reset_status.quat_change = quat_before_reset.inversed() * _state.quat_nominal;