From 5982eaaf34f53accbf8040c81e5c0ece3ed6487b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Jun 2015 10:54:09 +0200 Subject: [PATCH] MC pos control: Enforce minimum throttle in manual attitude control mode only if not landed, else default to idle throttle --- src/modules/mc_pos_control/mc_pos_control_main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 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 ad1ba56652..54c7608632 100644 --- a/src/modules/mc_pos_control/mc_pos_control_main.cpp +++ b/src/modules/mc_pos_control/mc_pos_control_main.cpp @@ -1414,7 +1414,11 @@ MulticopterPositionControl::task_main() /* control throttle directly if no climb rate controller is active */ if (!_control_mode.flag_control_climb_rate_enabled) { _att_sp.thrust = math::min(_manual.z, _params.thr_max); - _att_sp.thrust = math::max(_att_sp.thrust, _params.thr_min); + + /* enforce minimum throttle if not landed */ + if (!_vehicle_status.condition_landed) { + _att_sp.thrust = math::max(_att_sp.thrust, _params.thr_min); + } } /* construct attitude setpoint rotation matrix */