From 0f62dbf6ed7e2e63f53b69c7218b06c917417a7d Mon Sep 17 00:00:00 2001 From: priseborough Date: Mon, 25 Aug 2014 17:19:16 +1000 Subject: [PATCH] AP_NavEKF : Clear compass fail on transition between armed and disarmed This allows a compass that has been declared failed, possibly because of external disturbances (eg movement of hatches, proximity of tools, etc) to be given a second chance when the vehicle is armed. --- libraries/AP_NavEKF/AP_NavEKF.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_NavEKF/AP_NavEKF.cpp b/libraries/AP_NavEKF/AP_NavEKF.cpp index 931d20a17c..88c56e3645 100644 --- a/libraries/AP_NavEKF/AP_NavEKF.cpp +++ b/libraries/AP_NavEKF/AP_NavEKF.cpp @@ -608,6 +608,9 @@ void NavEKF::UpdateFilter() ResetPosition(); ResetHeight(); StoreStatesReset(); + // clear the magnetometer failed status as the failure may have been + // caused by external field disturbances associated with pre-flight activities + magFailed = false; calcQuatAndFieldStates(_ahrs->roll, _ahrs->pitch); prevStaticMode = staticMode; }