From b23f5e380c0e69b93da34f97926a14b15e0ff706 Mon Sep 17 00:00:00 2001 From: Stephen Dade Date: Thu, 22 Dec 2022 15:05:40 +1100 Subject: [PATCH] Copter: Allow arming in guided mode from scripting --- ArduCopter/AP_Arming.cpp | 4 ++-- ArduCopter/mode_guided.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArduCopter/AP_Arming.cpp b/ArduCopter/AP_Arming.cpp index 02403e2fd9..d78fbe3412 100644 --- a/ArduCopter/AP_Arming.cpp +++ b/ArduCopter/AP_Arming.cpp @@ -628,8 +628,8 @@ bool AP_Arming_Copter::arm_checks(AP_Arming::Method method) #else const char *rc_item = "Throttle"; #endif - // check throttle is not too high - skips checks if arming from GCS in Guided,Guided_NoGPS or Auto - if (!(method == AP_Arming::Method::MAVLINK && (copter.flightmode->mode_number() == Mode::Number::GUIDED || copter.flightmode->mode_number() == Mode::Number::GUIDED_NOGPS || copter.flightmode->mode_number() == Mode::Number::AUTO))) { + // check throttle is not too high - skips checks if arming from GCS/scripting in Guided,Guided_NoGPS or Auto + if (!((method == AP_Arming::Method::MAVLINK || method == AP_Arming::Method::SCRIPTING) && (copter.flightmode->mode_number() == Mode::Number::GUIDED || copter.flightmode->mode_number() == Mode::Number::GUIDED_NOGPS || copter.flightmode->mode_number() == Mode::Number::AUTO))) { // above top of deadband is too always high if (copter.get_pilot_desired_climb_rate(copter.channel_throttle->get_control_in()) > 0.0f) { check_failed(ARMING_CHECK_RC, true, "%s too high", rc_item); diff --git a/ArduCopter/mode_guided.cpp b/ArduCopter/mode_guided.cpp index 54771788b4..fd313a1c0d 100644 --- a/ArduCopter/mode_guided.cpp +++ b/ArduCopter/mode_guided.cpp @@ -99,8 +99,8 @@ void ModeGuided::run() bool ModeGuided::allows_arming(AP_Arming::Method method) const { - // always allow arming from the ground station - if (method == AP_Arming::Method::MAVLINK) { + // always allow arming from the ground station or scripting + if (method == AP_Arming::Method::MAVLINK || method == AP_Arming::Method::SCRIPTING) { return true; }