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:
Roman Bapst
2024-12-20 09:21:32 +01:00
committed by GitHub
parent 61961350f9
commit b765769f50
5 changed files with 31 additions and 6 deletions
+8 -2
View File
@@ -211,8 +211,14 @@ void Mission::setActiveMissionItems()
// prevent fixed wing lateral guidance from loitering at a waypoint as part of a mission landing if the altitude
// is not achieved.
if (_vehicle_status_sub.get().vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING && isLanding() &&
_mission_item.nav_cmd == NAV_CMD_WAYPOINT) {
const bool fw_on_mission_landing = _vehicle_status_sub.get().vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING
&& isLanding() &&
_mission_item.nav_cmd == NAV_CMD_WAYPOINT;
const bool mc_landing_after_transition = _vehicle_status_sub.get().vehicle_type ==
vehicle_status_s::VEHICLE_TYPE_ROTARY_WING && _vehicle_status_sub.get().is_vtol &&
new_work_item_type == WorkItemType::WORK_ITEM_TYPE_MOVE_TO_LAND;
if (fw_on_mission_landing || mc_landing_after_transition) {
pos_sp_triplet->current.alt_acceptance_radius = FLT_MAX;
}