From 98f3f59fb63d8bc66f55b7dd25e9a987ec9131e0 Mon Sep 17 00:00:00 2001 From: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:46:21 -0800 Subject: [PATCH] AP_ExternalControl: arm through external control * Prepare for external control enabled flag gating ability to arm in DDS Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com> --- libraries/AP_ExternalControl/AP_ExternalControl.cpp | 10 ++++++++++ libraries/AP_ExternalControl/AP_ExternalControl.h | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/libraries/AP_ExternalControl/AP_ExternalControl.cpp b/libraries/AP_ExternalControl/AP_ExternalControl.cpp index e0e92f0a29..92a97f18b7 100644 --- a/libraries/AP_ExternalControl/AP_ExternalControl.cpp +++ b/libraries/AP_ExternalControl/AP_ExternalControl.cpp @@ -5,6 +5,16 @@ // singleton instance AP_ExternalControl *AP_ExternalControl::singleton; +bool AP_ExternalControl::arm(AP_Arming::Method method, bool do_arming_checks) +{ + return AP::arming().arm(method, do_arming_checks); +} + +bool AP_ExternalControl::disarm(AP_Arming::Method method, bool do_disarm_checks) +{ + return AP::arming().disarm(method, do_disarm_checks); +} + AP_ExternalControl::AP_ExternalControl() { singleton = this; diff --git a/libraries/AP_ExternalControl/AP_ExternalControl.h b/libraries/AP_ExternalControl/AP_ExternalControl.h index 34228e2b7a..57670008f4 100644 --- a/libraries/AP_ExternalControl/AP_ExternalControl.h +++ b/libraries/AP_ExternalControl/AP_ExternalControl.h @@ -8,6 +8,7 @@ #if AP_EXTERNAL_CONTROL_ENABLED +#include #include #include @@ -32,6 +33,16 @@ public: return false; } + /* + Arm the vehicle + */ + virtual bool arm(AP_Arming::Method method, bool do_arming_checks) WARN_IF_UNUSED; + + /* + Disarm the vehicle + */ + virtual bool disarm(AP_Arming::Method method, bool do_disarm_checks) WARN_IF_UNUSED; + static AP_ExternalControl *get_singleton(void) WARN_IF_UNUSED { return singleton; }