From 2405baa2c9e59ef0a1cde17f0fcd0222d3b5f33d Mon Sep 17 00:00:00 2001
From: Matthias Grob <maetugr@gmail.com>
Date: Thu, 1 Mar 2018 14:08:21 +0100
Subject: [PATCH] FlightTasks: fix manual mode takeoff

With the new position control architercture manual mode and
potition mode run through the same logic and as a result
it had a throttle thershold for smooth takeoff also in
manual mode. This is fixed by by ignoring the threshold for
any mode which doesn't control the climb rate.
---
 src/modules/mc_pos_control/mc_pos_control_main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/mc_pos_control/mc_pos_control_main.cpp b/src/modules/mc_pos_control/mc_pos_control_main.cpp
index 7fb9de58b0..837699dec5 100644
--- a/src/modules/mc_pos_control/mc_pos_control_main.cpp
+++ b/src/modules/mc_pos_control/mc_pos_control_main.cpp
@@ -2998,7 +2998,7 @@ bool MulticopterPositionControl::manual_wants_takeoff()
 	const bool has_manual_control_present = _control_mode.flag_control_manual_enabled && _manual.timestamp > 0;
 
 	// Manual takeoff is triggered if the throttle stick is above 65%.
-	return (has_manual_control_present && _manual.z > 0.65f);
+	return (has_manual_control_present && (_manual.z > 0.65f || !_control_mode.flag_control_climb_rate_enabled));
 }
 
 void
-- 
GitLab