Skip to content

Commit

Permalink
Plane: Refactored quadplane's SLT_Transition::active_frwd()
Browse files Browse the repository at this point in the history
  • Loading branch information
Georacer authored and tridge committed Oct 16, 2024
1 parent 016a81b commit e9cdc46
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ArduPlane/quadplane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4374,9 +4374,20 @@ bool SLT_Transition::allow_update_throttle_mix() const

bool SLT_Transition::active_frwd() const
{
return quadplane.assisted_flight && // We need to be in assisted flight...
((transition_state == TRANSITION_AIRSPEED_WAIT) || (transition_state == TRANSITION_TIMER)) // ... and a transition must be active...
&& !quadplane.in_vtol_airbrake(); // ... but not executing an QPOS_AIRBRAKE maneuver during an automated landing.
// We need to be in assisted flight...
if (!quadplane.assisted_flight) {
return false;
}
// ... and a transition must be active...
if (!((transition_state == TRANSITION_AIRSPEED_WAIT) || (transition_state == TRANSITION_TIMER))) {
return false;
}
// ... but not executing a QPOS_AIRBRAKE maneuver during an automated landing.
if (quadplane.in_vtol_airbrake()) {
return false;
}

return true;
}

/*
Expand Down

0 comments on commit e9cdc46

Please sign in to comment.