GCS_MAVLink: fill SYS_STATUS bits from AC_Fence

This commit is contained in:
Peter Barker 2019-08-29 19:26:05 +10:00 committed by Andrew Tridgell
parent 9c900c7176
commit 9da0efaaef
1 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "GCS.h"
#include <AC_Fence/AC_Fence.h>
#include <AP_BoardConfig/AP_BoardConfig.h>
#include <AP_Logger/AP_Logger.h>
#include <AP_BattMonitor/AP_BattMonitor.h>
@ -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();
}