EKF: replace fault status struct with a union to facilitate logging

This commit is contained in:
Paul Riseborough
2016-05-07 21:11:16 +10:00
parent 7f5669fb2d
commit 020b87933e
7 changed files with 57 additions and 54 deletions
+4 -4
View File
@@ -456,8 +456,8 @@ void Ekf::fuseOptFlow()
// if the covariance correction will result in a negative variance, then
// the covariance marix is unhealthy and must be corrected
bool healthy = true;
_fault_status.bad_optflow_X = false;
_fault_status.bad_optflow_Y = false;
_fault_status.flags.bad_optflow_X = false;
_fault_status.flags.bad_optflow_Y = false;
for (int i = 0; i < _k_num_states; i++) {
if (P[i][i] < KHP[i][i]) {
// zero rows and columns
@@ -469,9 +469,9 @@ void Ekf::fuseOptFlow()
// update individual measurement health status
if (obs_index == 0) {
_fault_status.bad_optflow_X = true;
_fault_status.flags.bad_optflow_X = true;
} else if (obs_index == 1) {
_fault_status.bad_optflow_Y = true;
_fault_status.flags.bad_optflow_Y = true;
}
}
}