mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 07:43:34 +08:00
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:
@@ -1891,8 +1891,8 @@ MulticopterPositionControl::task_main()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_control_mode.flag_control_altitude_enabled) {
|
if (_control_mode.flag_control_climb_rate_enabled && !_control_mode.flag_control_velocity_enabled) {
|
||||||
/* thrust compensation for altitude only control modes */
|
/* thrust compensation when vertical velocity but not horizontal velocity is controlled */
|
||||||
float att_comp;
|
float att_comp;
|
||||||
|
|
||||||
if (_R(2, 2) > TILT_COS_MAX) {
|
if (_R(2, 2) > TILT_COS_MAX) {
|
||||||
|
|||||||
Reference in New Issue
Block a user