From 4e141fc67f21737d934bb4613a54634a49fce471 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Jul 2022 16:11:28 +1000 Subject: [PATCH] Plane: allow for throttle control in MANUAL when disarmed pass base throttle down to ICE subsystem to allow for throttle when disarmed in MANUAL --- ArduPlane/servos.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ArduPlane/servos.cpp b/ArduPlane/servos.cpp index 1ec3687bc8..29cca4fd13 100644 --- a/ArduPlane/servos.cpp +++ b/ArduPlane/servos.cpp @@ -880,6 +880,8 @@ void Plane::set_servos(void) // slew rate limit throttle throttle_slew_limit(SRV_Channel::k_throttle); + const float base_throttle = SRV_Channels::get_output_scaled(SRV_Channel::k_throttle); + if (!arming.is_armed()) { //Some ESCs get noisy (beep error msgs) if PWM == 0. //This little segment aims to avoid this. @@ -905,9 +907,9 @@ void Plane::set_servos(void) } } - uint8_t override_pct; - if (g2.ice_control.throttle_override(override_pct)) { - // the ICE controller wants to override the throttle for starting + float override_pct = SRV_Channels::get_output_scaled(SRV_Channel::k_throttle); + if (g2.ice_control.throttle_override(override_pct, base_throttle)) { + // the ICE controller wants to override the throttle for starting, idle, or redline SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, override_pct); #if HAL_QUADPLANE_ENABLED quadplane.vel_forward.integrator = 0;