mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-03 00:20:34 +08:00
handle line segment termination in navigator
- if following line segment (fixed-wing position control) switch waypoint when in acceptance radius OR passed the second waypoint. this handles the case of being beyond the second waypoint but not within the acceptance radius without the need to fly back to the waypoint (e.g. after a loiter up to waypoint alt) - sync navigator and fw pos ctrl waypoint acceptance altitude
This commit is contained in:
committed by
Silvan Fuhrer
parent
8a01135a93
commit
f8c2ee73db
@@ -994,7 +994,7 @@ FixedwingPositionControl::handle_setpoint_type(const uint8_t setpoint_type, cons
|
||||
// POSITION: achieve position setpoint altitude via loiter
|
||||
// close to waypoint, but altitude error greater than twice acceptance
|
||||
if ((!_vehicle_status.in_transition_mode) && (dist >= 0.f)
|
||||
&& (dist_z > 2.f * _param_fw_clmbout_diff.get())
|
||||
&& (dist_z > _param_nav_fw_alt_rad.get())
|
||||
&& (dist_xy < 2.f * math::max(acc_rad, loiter_radius_abs))) {
|
||||
// SETPOINT_TYPE_POSITION -> SETPOINT_TYPE_LOITER
|
||||
position_sp_type = position_setpoint_s::SETPOINT_TYPE_LOITER;
|
||||
|
||||
Reference in New Issue
Block a user