From 6daec07bbe5dfae8aa41bab5ba2da907ef397c54 Mon Sep 17 00:00:00 2001 From: mahima-yoga Date: Thu, 10 Jul 2025 15:46:56 +0200 Subject: [PATCH] fix: RTL during mission after a landing For delivery use-case, the mission contains a land item followed by other mission items. For the section after the land, the current sequence number is greater than the land start index. If an RTL is triggered, then isLanding returns true and the vehicle continues with the mission instead of executing the RTL. The land index marks the actual landing. So, is landing should only be true for the items between land_start_index and land_index. If there are items after the land index, then they don't belong to the landing anymore. --- src/modules/navigator/mission_base.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/navigator/mission_base.cpp b/src/modules/navigator/mission_base.cpp index daac61e933..d6ce8cc2c2 100644 --- a/src/modules/navigator/mission_base.cpp +++ b/src/modules/navigator/mission_base.cpp @@ -384,7 +384,8 @@ MissionBase::on_active() bool MissionBase::isLanding() { - if (hasMissionLandStart() && (_mission.current_seq > _mission.land_start_index)) { + if (hasMissionLandStart() && (_mission.current_seq > _mission.land_start_index) + && (_mission.current_seq <= _mission.land_index)) { static constexpr size_t max_num_next_items{1u}; int32_t next_mission_items_index[max_num_next_items]; size_t num_found_items;