Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c776f1

Browse files
MaEtUgRLorenzMeier
authored andcommitted
mc_att_control: fix applying not updated thrust setpoint
1 parent 953e5e5 commit 1c776f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/modules/mc_att_control/mc_att_control_main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,12 @@ MulticopterAttitudeControl::control_attitude()
521521
{
522522
vehicle_attitude_setpoint_poll();
523523

524+
// reinitialize the setpoint while not armed to make sure no value from the last flight is still kept
525+
if (!_v_control_mode.flag_armed) {
526+
Quatf().copyTo(_v_att_sp.q_d);
527+
Vector3f().copyTo(_v_att_sp.thrust_body);
528+
}
529+
524530
// physical thrust axis is the negative of body z axis
525531
_thrust_sp = -_v_att_sp.thrust_body[2];
526532

0 commit comments

Comments
 (0)