Skip to content

Commit ab8c40d

Browse files
committed
GCS_MAVLink: report airspeed unhealthy when being rejected
this gives the pilot feedback on airspeed failing EKF innnovation checks and switching to synthetic airspeed
1 parent aab0c31 commit ab8c40d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/GCS_MAVLink/GCS.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,12 @@ void GCS::update_sensor_status_flags()
269269
const AP_Airspeed *airspeed = AP_Airspeed::get_singleton();
270270
if (airspeed && airspeed->enabled()) {
271271
control_sensors_present |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE;
272-
if (airspeed->use()) {
272+
const bool use = airspeed->use();
273+
const bool enabled = AP::ahrs().airspeed_sensor_enabled();
274+
if (use) {
273275
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE;
274276
}
275-
if (airspeed->all_healthy()) {
277+
if (airspeed->all_healthy() && (!use || enabled)) {
276278
control_sensors_health |= MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE;
277279
}
278280
}

0 commit comments

Comments
 (0)