mc_pos_control: do not do tilt compensation when hor velocity is controlled

- fixed a bug where tilt compensation was done also when the horizontal
velocity was controlled. This is not needed because in this case
the controller outputs a 3D thrust vector.

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman 2016-12-05 08:44:29 +01:00 committed by Lorenz Meier
parent f15d1ce5e7
commit aabf753ecb
1 changed files with 2 additions and 2 deletions

View File

@ -1891,8 +1891,8 @@ MulticopterPositionControl::task_main()
}
}
if (_control_mode.flag_control_altitude_enabled) {
/* thrust compensation for altitude only control modes */
if (_control_mode.flag_control_climb_rate_enabled && !_control_mode.flag_control_velocity_enabled) {
/* thrust compensation when vertical velocity but not horizontal velocity is controlled */
float att_comp;
if (_R(2, 2) > TILT_COS_MAX) {