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>
This commit is contained in:
Ryan Friedman 2024-11-13 11:46:21 -08:00 committed by Peter Barker
parent 489e8473a2
commit 98f3f59fb6
2 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,16 @@
// singleton instance // singleton instance
AP_ExternalControl *AP_ExternalControl::singleton; 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() AP_ExternalControl::AP_ExternalControl()
{ {
singleton = this; singleton = this;

View File

@ -8,6 +8,7 @@
#if AP_EXTERNAL_CONTROL_ENABLED #if AP_EXTERNAL_CONTROL_ENABLED
#include <AP_Arming/AP_Arming.h>
#include <AP_Common/Location.h> #include <AP_Common/Location.h>
#include <AP_Math/AP_Math.h> #include <AP_Math/AP_Math.h>
@ -32,6 +33,16 @@ public:
return false; 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 { static AP_ExternalControl *get_singleton(void) WARN_IF_UNUSED {
return singleton; return singleton;
} }