From 13616d6436859e6ae5d75ee4fad1798ebf56ff19 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Tue, 21 Apr 2015 19:56:48 +1000 Subject: [PATCH] AP_NavEKF: Add takeoff and touchdown expected to reported filter status --- libraries/AP_NavEKF/AP_NavEKF.cpp | 2 ++ libraries/AP_NavEKF/AP_Nav_Common.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libraries/AP_NavEKF/AP_NavEKF.cpp b/libraries/AP_NavEKF/AP_NavEKF.cpp index 2b5661e533..c0390c67b7 100644 --- a/libraries/AP_NavEKF/AP_NavEKF.cpp +++ b/libraries/AP_NavEKF/AP_NavEKF.cpp @@ -4731,6 +4731,8 @@ void NavEKF::getFilterStatus(nav_filter_status &status) const status.flags.pred_horiz_pos_rel = (optFlowNavPossible || gpsNavPossible) && filterHealthy; // we should be able to estimate a relative position when we enter flight mode status.flags.pred_horiz_pos_abs = gpsNavPossible && filterHealthy; // we should be able to estimate an absolute position when we enter flight mode status.flags.takeoff_detected = takeOffDetected; // takeoff for optical flow navigation has been detected + status.flags.takeoff = takeoffExpected; // The EKF has been told to expect takeoff and is in a ground effect mitigation mode + status.flags.touchdown = touchdownExpected; // The EKF has been told to detect touchdown and is in a ground effect mitigation mode } // send an EKF_STATUS message to GCS diff --git a/libraries/AP_NavEKF/AP_Nav_Common.h b/libraries/AP_NavEKF/AP_Nav_Common.h index 2c851b2487..0fc3f6b955 100644 --- a/libraries/AP_NavEKF/AP_Nav_Common.h +++ b/libraries/AP_NavEKF/AP_Nav_Common.h @@ -32,6 +32,8 @@ union nav_filter_status { uint16_t pred_horiz_pos_rel : 1; // 8 - true if filter expects it can produce a good relative horizontal position estimate - used before takeoff uint16_t pred_horiz_pos_abs : 1; // 9 - true if filter expects it can produce a good absolute horizontal position estimate - used before takeoff uint16_t takeoff_detected : 1; // 10 - true if optical flow takeoff has been detected + uint16_t takeoff : 1; // 11 - true if filter is compensating for baro errors during takeoff + uint16_t touchdown : 1; // 12 - true if filter is compensating for baro errors during touchdown } flags; uint16_t value; };