Blimp: tidy setting of sensor status flags

This commit is contained in:
Peter Barker 2021-04-13 13:55:54 +10:00 committed by Andrew Tridgell
parent cb7ac6fb54
commit ed4dcea57a
1 changed files with 4 additions and 5 deletions

View File

@ -14,6 +14,7 @@ const char* GCS_Blimp::frame_string() const
void GCS_Blimp::update_vehicle_sensor_status_flags(void)
{
// mode-specific flags:
control_sensors_present |=
MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL |
MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION |
@ -29,18 +30,16 @@ void GCS_Blimp::update_vehicle_sensor_status_flags(void)
MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION |
MAV_SYS_STATUS_SENSOR_YAW_POSITION;
control_sensors_present |= MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL;
control_sensors_present |= MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL;
const Blimp::ap_t &ap = blimp.ap;
if (ap.rc_receiver_present) {
control_sensors_present |= MAV_SYS_STATUS_SENSOR_RC_RECEIVER;
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_RC_RECEIVER;
}
control_sensors_present |= MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL;
control_sensors_present |= MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL;
if (ap.rc_receiver_present && !blimp.failsafe.radio) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_RC_RECEIVER;
}
}