From ab8c40d9bc7d345186ad67c9324360a93eb56c5f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Jan 2022 17:37:29 +1100 Subject: [PATCH] GCS_MAVLink: report airspeed unhealthy when being rejected this gives the pilot feedback on airspeed failing EKF innnovation checks and switching to synthetic airspeed --- libraries/GCS_MAVLink/GCS.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS.cpp b/libraries/GCS_MAVLink/GCS.cpp index ce46d4349f..2495ed40ac 100644 --- a/libraries/GCS_MAVLink/GCS.cpp +++ b/libraries/GCS_MAVLink/GCS.cpp @@ -269,10 +269,12 @@ void GCS::update_sensor_status_flags() const AP_Airspeed *airspeed = AP_Airspeed::get_singleton(); if (airspeed && airspeed->enabled()) { control_sensors_present |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; - if (airspeed->use()) { + const bool use = airspeed->use(); + const bool enabled = AP::ahrs().airspeed_sensor_enabled(); + if (use) { control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; } - if (airspeed->all_healthy()) { + if (airspeed->all_healthy() && (!use || enabled)) { control_sensors_health |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE; } }