From 987b556299fae1f9e9f699983d3d188eb50fef0f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Sep 2018 08:43:41 +1000 Subject: [PATCH] Plane: disable crash detection if no GPS and no airspeed --- ArduPlane/is_flying.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ArduPlane/is_flying.cpp b/ArduPlane/is_flying.cpp index 0c2c17dc69..8e7121375d 100644 --- a/ArduPlane/is_flying.cpp +++ b/ArduPlane/is_flying.cpp @@ -278,6 +278,12 @@ void Plane::crash_detection_update(void) crash_state.checkedHardLanding = false; } + // if we have no GPS lock and we don't have a functional airspeed + // sensor then don't do crash detection + if (gps.status() < AP_GPS::GPS_OK_FIX_3D && (!airspeed.use() || !airspeed.healthy())) { + crashed = false; + } + if (!crashed) { // reset timer crash_state.debounce_timer_ms = 0;