Skip to content

Commit aabf753

Browse files
RomanBapstLorenzMeier
authored andcommitted
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 <[email protected]>
1 parent f15d1ce commit aabf753

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modules/mc_pos_control/mc_pos_control_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,8 +1891,8 @@ MulticopterPositionControl::task_main()
18911891
}
18921892
}
18931893

1894-
if (_control_mode.flag_control_altitude_enabled) {
1895-
/* thrust compensation for altitude only control modes */
1894+
if (_control_mode.flag_control_climb_rate_enabled && !_control_mode.flag_control_velocity_enabled) {
1895+
/* thrust compensation when vertical velocity but not horizontal velocity is controlled */
18961896
float att_comp;
18971897

18981898
if (_R(2, 2) > TILT_COS_MAX) {

0 commit comments

Comments
 (0)