mc_att_control: fix applying not updated thrust setpoint

This commit is contained in:
Matthias Grob
2019-05-22 12:44:47 +01:00
committed by Lorenz Meier
parent 953e5e5019
commit 1c776f16ec
@@ -521,6 +521,12 @@ MulticopterAttitudeControl::control_attitude()
{
vehicle_attitude_setpoint_poll();
// reinitialize the setpoint while not armed to make sure no value from the last flight is still kept
if (!_v_control_mode.flag_armed) {
Quatf().copyTo(_v_att_sp.q_d);
Vector3f().copyTo(_v_att_sp.thrust_body);
}
// physical thrust axis is the negative of body z axis
_thrust_sp = -_v_att_sp.thrust_body[2];