Skip to content

Commit 4803bc1

Browse files
committed
Sub: correct setting of MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE
we only want to be present and enabled if there is actually a depth sensor on board. Otherwise we can be present and enabled but never healthy when we don't have a depth sensor
1 parent a43049d commit 4803bc1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ArduSub/GCS_Sub.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ void GCS_Sub::update_vehicle_sensor_status_flags()
4141
}
4242

4343
// override the parent class's values for ABSOLUTE_PRESSURE to
44-
// only check internal barometer:
44+
// only honour water-pressure sensors
45+
control_sensors_present &= ~MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
46+
control_sensors_enabled &= ~MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
47+
control_sensors_health &= ~MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
4548
if (sub.ap.depth_sensor_present) {
4649
control_sensors_present |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
4750
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
48-
}
49-
control_sensors_health &= ~MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE; // check the internal barometer only
50-
if (sub.sensor_health.depth) {
51-
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
51+
if (sub.sensor_health.depth) {
52+
control_sensors_health |= MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE;
53+
}
5254
}
5355

5456
#if AP_TERRAIN_AVAILABLE

0 commit comments

Comments
 (0)