forked from Archive/PX4-Autopilot
mc_att_control: yaw offset limiting bug fixed
This commit is contained in:
parent
42a7d80a81
commit
8e43db7bc0
|
@ -509,10 +509,10 @@ MulticopterAttitudeControl::control_attitude(float dt)
|
|||
float yaw_offs_max = _params.man_yaw_max / _params.att_p(2);
|
||||
float yaw_offs = _wrap_pi(_v_att_sp.yaw_body - _v_att.yaw);
|
||||
if (yaw_offs < - yaw_offs_max) {
|
||||
_v_att_sp.yaw_body = _wrap_pi(_v_att.yaw - yaw_offs);
|
||||
_v_att_sp.yaw_body = _wrap_pi(_v_att.yaw - yaw_offs_max);
|
||||
|
||||
} else if (yaw_offs > yaw_offs_max) {
|
||||
_v_att_sp.yaw_body = _wrap_pi(_v_att.yaw + yaw_offs);
|
||||
_v_att_sp.yaw_body = _wrap_pi(_v_att.yaw + yaw_offs_max);
|
||||
}
|
||||
_v_att_sp.R_valid = false;
|
||||
publish_att_sp = true;
|
||||
|
|
Loading…
Reference in New Issue