Sub: Check if depth sensor is present for sensor reporting

This commit is contained in:
Jacob Walser 2016-11-18 21:45:07 -05:00 committed by Andrew Tridgell
parent 456f5e2e93
commit 974af85f42
1 changed files with 6 additions and 3 deletions

View File

@ -193,9 +193,12 @@ NOINLINE void Sub::send_extended_status1(mavlink_channel_t chan)
MAV_SYS_STATUS_SENSOR_3D_MAG |
MAV_SYS_STATUS_SENSOR_GPS |
MAV_SYS_STATUS_SENSOR_RC_RECEIVER);
if (barometer.all_healthy()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
}
if (ap.depth_sensor_present && barometer.all_healthy()) { // check all barometers
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
} else if (barometer.healthy(0)) { // check the internal barometer only
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
}
if (g.compass_enabled && compass.healthy() && ahrs.use_compass()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_3D_MAG;
}