Plane: `set_throttle` add early return for disarmed and throttle suppression

This commit is contained in:
Iampete1 2023-12-22 16:09:42 +00:00 committed by Andrew Tridgell
parent 3e955d12fa
commit 17fb9455a9
1 changed files with 10 additions and 3 deletions

View File

@ -551,7 +551,10 @@ void Plane::set_throttle(void)
SRV_Channels::set_output_limit(SRV_Channel::k_throttleLeft, SRV_Channel::Limit::ZERO_PWM);
SRV_Channels::set_output_limit(SRV_Channel::k_throttleRight, SRV_Channel::Limit::ZERO_PWM);
}
} else if (suppress_throttle()) {
return;
}
if (suppress_throttle()) {
if (g.throttle_suppress_manual) {
// manual pass through of throttle while throttle is suppressed
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, get_throttle_input(true));
@ -565,11 +568,15 @@ void Plane::set_throttle(void)
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0.0);
}
return;
}
#if AP_SCRIPTING_ENABLED
} else if (nav_scripting_active()) {
if (nav_scripting_active()) {
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, plane.nav_scripting.throttle_pct);
} else
#endif
} else if (control_mode == &mode_stabilize ||
if (control_mode == &mode_stabilize ||
control_mode == &mode_training ||
control_mode == &mode_acro ||
control_mode == &mode_fbwa ||