mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
tailsitter: do not condition transition on airspeed if airspeed disabled
Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -130,16 +130,19 @@ void Tailsitter::update_vtol_state()
|
||||
case FW_MODE:
|
||||
break;
|
||||
|
||||
case TRANSITION_FRONT_P1:
|
||||
case TRANSITION_FRONT_P1: {
|
||||
|
||||
// check if we have reached airspeed and pitch angle to switch to TRANSITION P2 mode
|
||||
if ((_airspeed->indicated_airspeed_m_s >= _params->transition_airspeed
|
||||
&& pitch <= PITCH_TRANSITION_FRONT_P1) || can_transition_on_ground()) {
|
||||
_vtol_schedule.flight_mode = FW_MODE;
|
||||
bool airspeed_condition_satisfied = _airspeed->indicated_airspeed_m_s >= _params->transition_airspeed;
|
||||
airspeed_condition_satisfied |= _params->airspeed_disabled;
|
||||
|
||||
// check if we have reached airspeed and pitch angle to switch to TRANSITION P2 mode
|
||||
if ((airspeed_condition_satisfied && pitch <= PITCH_TRANSITION_FRONT_P1) || can_transition_on_ground()) {
|
||||
_vtol_schedule.flight_mode = FW_MODE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TRANSITION_BACK:
|
||||
// failsafe into fixed wing mode
|
||||
_vtol_schedule.flight_mode = FW_MODE;
|
||||
|
||||
Reference in New Issue
Block a user