mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 15:23:33 +08:00
also don't reset possp if near a loiter sp
This commit is contained in:
committed by
Lorenz Meier
parent
ee0aa7b37d
commit
e0405617ef
@@ -1073,7 +1073,8 @@ void MulticopterPositionControl::control_auto(float dt)
|
||||
* 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.
|
||||
*/
|
||||
if (_pos_sp_triplet.current.type == position_setpoint_s::SETPOINT_TYPE_TAKEOFF
|
||||
if ((_pos_sp_triplet.current.type == position_setpoint_s::SETPOINT_TYPE_TAKEOFF
|
||||
|| _pos_sp_triplet.current.type == position_setpoint_s::SETPOINT_TYPE_LOITER)
|
||||
&& _pos_sp_triplet.current.acceptance_radius > 0.0f
|
||||
/* need to detect we're close a bit before the navigator switches from takeoff to next waypoint */
|
||||
&& (_pos - _pos_sp).length() < _pos_sp_triplet.current.acceptance_radius * 1.2f) {
|
||||
|
||||
Reference in New Issue
Block a user