GCS_MAVLink: correct sensors when no baros found

GCSs will know we have no baros on-board, as will the RC telemetry library
This commit is contained in:
Peter Barker 2023-09-18 18:48:01 +10:00 committed by Peter Barker
parent 6d1fed9657
commit 273b9ea354

View File

@ -184,10 +184,12 @@ void GCS::update_sensor_status_flags()
#if AP_BARO_ENABLED
const AP_Baro &barometer = AP::baro();
control_sensors_present |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
if (barometer.all_healthy()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
if (barometer.num_instances() > 0) {
control_sensors_present |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
if (barometer.all_healthy()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
}
}
#endif