From d6a86dfa56fc2d7ed566b0c065262acd1af91878 Mon Sep 17 00:00:00 2001
From: Roman <bapstroman@gmail.com>
Date: Tue, 3 Apr 2018 10:07:06 +0200
Subject: [PATCH] tailsitter: do not condition transition on airspeed if
 airspeed disabled

Signed-off-by: Roman <bapstroman@gmail.com>
---
 src/modules/vtol_att_control/tailsitter.cpp | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/modules/vtol_att_control/tailsitter.cpp b/src/modules/vtol_att_control/tailsitter.cpp
index 7a73bc23d1..f3af043a5f 100644
--- a/src/modules/vtol_att_control/tailsitter.cpp
+++ b/src/modules/vtol_att_control/tailsitter.cpp
@@ -130,15 +130,18 @@ 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;
 
-			break;
+				// 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;
+			}
 
 		case TRANSITION_BACK:
 			// failsafe into fixed wing mode
-- 
GitLab