Stop overwriting fault status with false if one component is true

This commit is contained in:
kamilritz 2020-06-27 17:51:50 +02:00 committed by Mathieu Bresciani
parent e5ddd912a4
commit 9e211d6ca1

View File

@ -172,6 +172,7 @@ 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)) {
@ -181,9 +182,6 @@ void Ekf::fuseVelPosHeight(const float innov, const float innov_var, const int o
healthy = false;
setVelPosFaultStatus(obs_index, true);
} else {
setVelPosFaultStatus(obs_index, false);
}
}