mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 10:03:34 +08:00
Navigator: Set altitude acceptance radius to infinity when moving to land point after transition (#24115)
* Navigator: set alt acceptance radius to infinity for land waypoint after backtransition -> avoid vehicle with depleted battery from not reaching the alt setpoint and getting stuck Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -1145,8 +1145,13 @@ float Navigator::get_altitude_acceptance_radius()
|
||||
|
||||
const position_controller_status_s &pos_ctrl_status = _position_controller_status_sub.get();
|
||||
|
||||
if ((pos_ctrl_status.timestamp > _pos_sp_triplet.timestamp)
|
||||
&& pos_ctrl_status.altitude_acceptance > alt_acceptance_radius) {
|
||||
const position_setpoint_s &curr_sp = get_position_setpoint_triplet()->current;
|
||||
|
||||
if (PX4_ISFINITE(curr_sp.alt_acceptance_radius) && curr_sp.alt_acceptance_radius > FLT_EPSILON) {
|
||||
alt_acceptance_radius = curr_sp.alt_acceptance_radius;
|
||||
|
||||
} else if ((pos_ctrl_status.timestamp > _pos_sp_triplet.timestamp)
|
||||
&& pos_ctrl_status.altitude_acceptance > alt_acceptance_radius) {
|
||||
alt_acceptance_radius = pos_ctrl_status.altitude_acceptance;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user