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.
This commit is contained in:
mahima-yoga
2025-07-10 15:46:56 +02:00
committed by Silvan Fuhrer
parent 6e1ab343f6
commit 6daec07bbe

View File

@@ -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;