diff --git a/EKF/common.h b/EKF/common.h index 653ce9df60..4cca1ec5d1 100644 --- a/EKF/common.h +++ b/EKF/common.h @@ -506,6 +506,7 @@ union ekf_solution_status { uint16_t pred_pos_horiz_rel : 1; // 8 - True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate uint16_t pred_pos_horiz_abs : 1; // 9 - True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate uint16_t gps_glitch : 1; // 10 - True if the EKF has detected a GPS glitch + uint16_t accel_error : 1; // 11 - True if the EKF has detected bad accelerometer data } flags; uint16_t value; }; diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index ffff704b7f..6f1acc217f 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -862,6 +862,7 @@ void Ekf::get_ekf_soln_status(uint16_t *status) bool gps_pos_innov_bad = (_vel_pos_test_ratio[3] > 1.0f) || (_vel_pos_test_ratio[4] > 1.0f); bool mag_innov_good = (_mag_test_ratio[0] < 1.0f) && (_mag_test_ratio[1] < 1.0f) && (_mag_test_ratio[2] < 1.0f) && (_yaw_test_ratio < 1.0f); soln_status.flags.gps_glitch = (gps_vel_innov_bad || gps_pos_innov_bad) && mag_innov_good; + soln_status.flags.accel_error = _bad_vert_accel_detected; *status = soln_status.value; }