mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
mc_att_control: fix applying not updated thrust setpoint
This commit is contained in:
committed by
Lorenz Meier
parent
953e5e5019
commit
1c776f16ec
@@ -521,6 +521,12 @@ MulticopterAttitudeControl::control_attitude()
|
|||||||
{
|
{
|
||||||
vehicle_attitude_setpoint_poll();
|
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
|
// physical thrust axis is the negative of body z axis
|
||||||
_thrust_sp = -_v_att_sp.thrust_body[2];
|
_thrust_sp = -_v_att_sp.thrust_body[2];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user