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

Commit

Permalink
EKF: limit yaw variance increase to 0.01 rad^2 to prevent a badly con…
Browse files Browse the repository at this point in the history
…ditioned covariance matrix

Signed-off-by: CarlOlsson <[email protected]>
  • Loading branch information
CarlOlsson committed Jan 16, 2019
1 parent 3d716c4 commit d36be5b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions EKF/ekf_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,9 @@ void Ekf::increaseQuatYawErrVariance(float yaw_variance)
SQ[2] = 0.5f * ((_state.quat_nominal(3)*SG[0]) - (_state.quat_nominal(1)*SG[1]) + (_state.quat_nominal(2)*SG[2]));
SQ[3] = 0.5f * ((_state.quat_nominal(0)*SG[0]) + (_state.quat_nominal(1)*SG[2]) + (_state.quat_nominal(2)*SG[1]));

// Limit yaw variance increase to prevent a badly conditioned covariance matrix
yaw_variance = fminf(yaw_variance, 1.0e-2f);

// Add covariances for additonal yaw uncertainty to existing covariances.
// This assumes that the additional yaw error is uncorrrelated to existing errors
P[0][0] += yaw_variance*sq(SQ[2]);
Expand Down

0 comments on commit d36be5b

Please sign in to comment.