Small cleanup in velposfusion

This commit is contained in:
kamilritz 2020-08-22 10:24:23 +02:00 committed by Paul Riseborough
parent 644e903552
commit aa2c77f92d

View File

@ -172,7 +172,6 @@ void Ekf::fuseVelPosHeight(const float innov, const float innov_var, const int o
// if the covariance correction will result in a negative variance, then
// the covariance matrix is unhealthy and must be corrected
bool healthy = true;
setVelPosFaultStatus(obs_index, false);
for (int i = 0; i < _k_num_states; i++) {
if (P(i, i) < KHP(i, i)) {
@ -180,11 +179,11 @@ void Ekf::fuseVelPosHeight(const float innov, const float innov_var, const int o
P.uncorrelateCovarianceSetVariance<1>(i, 0.0f);
healthy = false;
setVelPosFaultStatus(obs_index, true);
}
}
setVelPosFaultStatus(obs_index, !healthy);
if (healthy) {
// apply the covariance corrections
P -= KHP;