mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 10:13:34 +08:00
mc_att_control: adapt setpoint on estimation reset
There was a gap where the attitude controller already used the estimate with a new reference but the last known attitude setpoint was still based on the old reference. This leads to a big glitch on reset because until the attitude setpoint gets updated the error is wrong and as large as the attitude delta of the reset.
This commit is contained in:
committed by
Roman Bapst
parent
cf658494ad
commit
12ee75700a
@@ -286,7 +286,9 @@ MulticopterAttitudeControl::Run()
|
||||
// Check for a heading reset
|
||||
if (prev_quat_reset_counter != _v_att.quat_reset_counter) {
|
||||
// we only extract the heading change from the delta quaternion
|
||||
_man_yaw_sp += Eulerf(Quatf(_v_att.delta_q_reset)).psi();
|
||||
const Quatf delta_q_reset(_v_att.delta_q_reset);
|
||||
_man_yaw_sp += Eulerf(delta_q_reset).psi();
|
||||
_attitude_control.adaptAttitudeSetpoint(delta_q_reset);
|
||||
}
|
||||
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
Reference in New Issue
Block a user