mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 16:48:52 +08:00
mc_pos_control: only set current_setpoint to true if triplet valid
This commit is contained in:
@@ -1392,9 +1392,6 @@ void MulticopterPositionControl::control_auto(float dt)
|
||||
_pos_sp_triplet.current.lat, _pos_sp_triplet.current.lon,
|
||||
&_curr_pos_sp.data[0], &_curr_pos_sp.data[1]);
|
||||
|
||||
} else {
|
||||
_curr_pos_sp(0) = _pos(0);
|
||||
_curr_pos_sp(1) = _pos(1);
|
||||
}
|
||||
|
||||
//only project setpoints if they are finite, else use current position
|
||||
@@ -1555,6 +1552,7 @@ void MulticopterPositionControl::control_auto(float dt)
|
||||
_att_sp.yaw_body = _pos_sp_triplet.current.yaw;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* if we're already near the current takeoff setpoint don't reset in case we switch back to posctl.
|
||||
* this makes the takeoff finish smoothly.
|
||||
|
||||
Reference in New Issue
Block a user