From e7690bd8f87989d8684c235f6f64f6d8bdd104b6 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Mon, 23 May 2016 16:25:26 +1000 Subject: [PATCH] EKF: capture magnetometer innovation test failures --- EKF/mag_fusion.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EKF/mag_fusion.cpp b/EKF/mag_fusion.cpp index 966db4172c..9c41a1eb35 100644 --- a/EKF/mag_fusion.cpp +++ b/EKF/mag_fusion.cpp @@ -183,6 +183,9 @@ void Ekf::fuseMag() if (_mag_test_ratio[index] > 1.0f) { _mag_healthy = false; + _sensor_fault_status.value |= (1 << (index + 3)); + } else { + _sensor_fault_status.value &= !(1 << (index + 3)); } }