mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
mc_pos_control: make sure that passing waypoint only allowed if altitude is reached
This commit is contained in:
parent
b769d1cee0
commit
9ec0d72f3c
@ -1725,7 +1725,11 @@ void MulticopterPositionControl::control_auto(float dt)
|
||||
} else if (close_to_current) {
|
||||
/* slow down when close to current setpoint */
|
||||
|
||||
if (next_setpoint_valid && !(_pos_sp_triplet.current.type == position_setpoint_s::SETPOINT_TYPE_LOITER)) {
|
||||
/* check if altidue is within acceptance radius */
|
||||
bool reached_altitude = (dist_to_current_z < _nav_rad.get()) ? true : false;
|
||||
|
||||
if (reached_altitude && next_setpoint_valid
|
||||
&& !(_pos_sp_triplet.current.type == position_setpoint_s::SETPOINT_TYPE_LOITER)) {
|
||||
/* since we have a next setpoint use the angle prev-current-next to compute velocity setpoint limit */
|
||||
|
||||
/* get velocity close to current that depends on angle between prev-current and current-next line */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user