diff --git a/libraries/GCS_MAVLink/GCS.cpp b/libraries/GCS_MAVLink/GCS.cpp index 80ff8010b9..979464fcd0 100644 --- a/libraries/GCS_MAVLink/GCS.cpp +++ b/libraries/GCS_MAVLink/GCS.cpp @@ -7,6 +7,8 @@ #include #include #include +#include +#include extern const AP_HAL::HAL& hal; @@ -193,6 +195,16 @@ void GCS::update_sensor_status_flags() } } + // give GCS status of prearm checks. This is enabled if any arming checks are enabled. + // it is healthy if armed or checks are passing + control_sensors_present |= MAV_SYS_STATUS_PREARM_CHECK; + if (AP::arming().get_enabled_checks()) { + control_sensors_enabled |= MAV_SYS_STATUS_PREARM_CHECK; + if (hal.util->get_soft_armed() || AP_Notify::flags.pre_arm_check) { + control_sensors_health |= MAV_SYS_STATUS_PREARM_CHECK; + } + } + update_vehicle_sensor_status_flags(); }