From 9da0efaaefb5e2d8bddf1f7600d14faa3508e57a Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 29 Aug 2019 19:26:05 +1000 Subject: [PATCH] GCS_MAVLink: fill SYS_STATUS bits from AC_Fence --- libraries/GCS_MAVLink/GCS.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS.cpp b/libraries/GCS_MAVLink/GCS.cpp index 75275638ef..cd290e000a 100644 --- a/libraries/GCS_MAVLink/GCS.cpp +++ b/libraries/GCS_MAVLink/GCS.cpp @@ -1,5 +1,6 @@ #include "GCS.h" +#include #include #include #include @@ -177,6 +178,19 @@ void GCS::update_sensor_status_flags() } #endif + const AC_Fence *fence = AP::fence(); + if (fence != nullptr) { + if (fence->sys_status_enabled()) { + control_sensors_enabled |= MAV_SYS_STATUS_GEOFENCE; + } + if (fence->sys_status_present()) { + control_sensors_present |= MAV_SYS_STATUS_GEOFENCE; + } + if (!fence->sys_status_failed()) { + control_sensors_health |= MAV_SYS_STATUS_GEOFENCE; + } + } + update_vehicle_sensor_status_flags(); }