From 87988d65c5efacf13d93b74834cc825904979428 Mon Sep 17 00:00:00 2001 From: Tiziano Fiorenzani Date: Sat, 19 Oct 2024 21:43:44 +0000 Subject: [PATCH] AP_DDS: Status message includes external_control flag --- Tools/ros2/ardupilot_msgs/msg/Status.msg | 1 + libraries/AP_DDS/AP_DDS_Client.cpp | 1 + libraries/AP_DDS/Idl/ardupilot_msgs/msg/Status.idl | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/Tools/ros2/ardupilot_msgs/msg/Status.msg b/Tools/ros2/ardupilot_msgs/msg/Status.msg index 2b569f0dd7770..38ff02804d12c 100644 --- a/Tools/ros2/ardupilot_msgs/msg/Status.msg +++ b/Tools/ros2/ardupilot_msgs/msg/Status.msg @@ -18,6 +18,7 @@ uint8 vehicle_type # From AP_Vehicle_Type.h bool armed # true if vehicle is armed. uint8 mode # Vehicle mode, enum depending on vehicle type. bool flying # True if flying/driving/diving/tracking. +bool external_control # True is external control is enabled. uint8 FS_RADIO = 21 uint8 FS_BATTERY = 22 diff --git a/libraries/AP_DDS/AP_DDS_Client.cpp b/libraries/AP_DDS/AP_DDS_Client.cpp index 2fc5caf10d30b..c0d707aa8a8aa 100644 --- a/libraries/AP_DDS/AP_DDS_Client.cpp +++ b/libraries/AP_DDS/AP_DDS_Client.cpp @@ -617,6 +617,7 @@ bool AP_DDS_Client::update_topic(ardupilot_msgs_msg_Status& msg) msg.armed = hal.util->get_soft_armed(); msg.mode = vehicle->get_mode(); msg.flying = vehicle->get_likely_flying(); + msg.external_control = true; // Always true for now. To be filled after PR#28429. uint8_t fs_iter = 0; msg.failsafe_size = 0; if (AP_Notify::flags.failsafe_radio) { diff --git a/libraries/AP_DDS/Idl/ardupilot_msgs/msg/Status.idl b/libraries/AP_DDS/Idl/ardupilot_msgs/msg/Status.idl index 555aed78bc7bb..775353e17438a 100644 --- a/libraries/AP_DDS/Idl/ardupilot_msgs/msg/Status.idl +++ b/libraries/AP_DDS/Idl/ardupilot_msgs/msg/Status.idl @@ -36,6 +36,10 @@ module ardupilot_msgs { "true if vehicle is armed.") boolean armed; + @verbatim (language="comment", text= + "true is external control is enabled.") + boolean external_control; + @verbatim (language="comment", text= "Vehicle mode, enum depending on vehicle type.") uint8 mode;