From 03a266a961598fd4d0332c61a5601533d1b3e4cb Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Mon, 5 May 2025 08:15:04 -0500 Subject: [PATCH] Sub:add aux func disarm to pre-arm check for disarm function --- ArduSub/AP_Arming_Sub.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ArduSub/AP_Arming_Sub.cpp b/ArduSub/AP_Arming_Sub.cpp index a4c732d6a54f0..490b7a30a2383 100644 --- a/ArduSub/AP_Arming_Sub.cpp +++ b/ArduSub/AP_Arming_Sub.cpp @@ -38,6 +38,13 @@ bool AP_Arming_Sub::has_disarm_function() const { } } } + // check if an AUX function that disarms or estops is setup + if (rc().find_channel_for_option(RC_Channel::AUX_FUNC::MOTOR_ESTOP) || + rc().find_channel_for_option(RC_Channel::AUX_FUNC::DISARM) || + rc().find_channel_for_option(RC_Channel::AUX_FUNC::ARMDISARM) || + rc().find_channel_for_option(RC_Channel::AUX_FUNC::ARM_EMERGENCY_STOP)) { + return true; + } return false; } @@ -48,7 +55,7 @@ bool AP_Arming_Sub::pre_arm_checks(bool display_failure) } // don't allow arming unless there is a disarm button configured if (!has_disarm_function()) { - check_failed(display_failure, "Must assign a disarm or arm_toggle button"); + check_failed(display_failure, "Must assign a disarm or arm_toggle button or disarm aux function"); return false; }