Plane: never stick mix without valid RC input

This commit is contained in:
Iampete1 2022-03-08 15:05:19 +00:00 committed by Andrew Tridgell
parent bb3bedb90d
commit a7bc844780
1 changed files with 5 additions and 3 deletions

View File

@ -61,6 +61,10 @@ float Plane::calc_speed_scaler(void)
*/
bool Plane::stick_mixing_enabled(void)
{
if (!rc().has_valid_input()) {
// never stick mix without valid RC
return false;
}
#if AC_FENCE == ENABLED
const bool stickmixing = fence_stickmixing();
#else
@ -81,9 +85,7 @@ bool Plane::stick_mixing_enabled(void)
// we're in an auto mode. Check the stick mixing flag
if (g.stick_mixing != StickMixing::NONE &&
g.stick_mixing != StickMixing::VTOL_YAW &&
stickmixing &&
!rc_failsafe_active()) {
// we're in an auto mode, and haven't triggered rc failsafe
stickmixing) {
return true;
} else {
return false;