mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 05:33:33 +08:00
ensure attitude setpoint initialization before arming
- On initialization _v_att_sp got filled with zeros leaving invalid quaternions - While not armed mc_pos_control did not publish any attitude setpoint which makes no sense - The attitude control just uses the data in _v_att_sp if it was (ever) updated or not
This commit is contained in:
@@ -389,6 +389,10 @@ _loop_update_rate_hz(initial_update_rate_hz)
|
||||
|
||||
_vehicle_status.is_rotary_wing = true;
|
||||
|
||||
/* initialize quaternions in messages to be valid */
|
||||
_v_att.q[0] = 1.f;
|
||||
_v_att_sp.q_d[0] = 1.f;
|
||||
|
||||
_params.rate_p.zero();
|
||||
_params.rate_i.zero();
|
||||
_params.rate_int_lim.zero();
|
||||
|
||||
Reference in New Issue
Block a user