MC pos control: Enforce minimum throttle in manual attitude control mode only if not landed, else default to idle throttle

This commit is contained in:
Lorenz Meier 2015-06-27 10:54:09 +02:00
parent 7b05165249
commit 5982eaaf34
1 changed files with 5 additions and 1 deletions

View File

@ -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 */