GCS_MAVLink: move RC bits in mavlink to common code

Plane's semantics change to be like Copter. Rover, Sub and Tracker will start reporting the bits
This commit is contained in:
Peter Barker 2024-02-07 15:14:27 +11:00 committed by Peter Barker
parent 1e7df560aa
commit c23ba04638
1 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include <AP_Notify/AP_Notify.h>
#include <AP_OpticalFlow/AP_OpticalFlow.h>
#include <AP_GPS/AP_GPS.h>
#include <RC_Channel/RC_Channel.h>
#include "MissionItemProtocol_Waypoints.h"
#include "MissionItemProtocol_Rally.h"
@ -340,6 +341,16 @@ void GCS::update_sensor_status_flags()
}
#endif
#if AP_RC_CHANNEL_ENABLED
if (rc().has_ever_seen_rc_input()) {
control_sensors_present |= MAV_SYS_STATUS_SENSOR_RC_RECEIVER;
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_RC_RECEIVER;
if (!rc().in_rc_failsafe()) { // should this be has_valid_input?
control_sensors_health |= MAV_SYS_STATUS_SENSOR_RC_RECEIVER;
}
}
#endif
update_vehicle_sensor_status_flags();
}