From 348a558a15fd7847080789d3166d9e60f3671e16 Mon Sep 17 00:00:00 2001 From: Pavel Guzenfeld Date: Sun, 22 Mar 2026 08:16:04 +0200 Subject: [PATCH] fix(navigator): correct mission resume waypoint with camera triggering getPreviousPositionItems() already decrements the start index internally before searching. The call in on_activation() at line 227 passed _inactivation_index - 1, causing a double-decrement that made the vehicle resume at waypoint n-2 instead of n-1. All other call sites (rtl_mission_fast_reverse.cpp:81, rtl_mission_fast_reverse.cpp:133, mission_base.cpp:1149) pass the index directly without pre-decrementing. The bug has been present since commit 007ed11bbe (June 2023). Closes #26795 Signed-off-by: Pavel Guzenfeld --- src/modules/navigator/mission_base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/navigator/mission_base.cpp b/src/modules/navigator/mission_base.cpp index ba9872a34c..55cc10036b 100644 --- a/src/modules/navigator/mission_base.cpp +++ b/src/modules/navigator/mission_base.cpp @@ -224,7 +224,7 @@ MissionBase::on_activation() if (_inactivation_index > 0 && cameraWasTriggering()) { size_t num_found_items{0U}; - getPreviousPositionItems(_inactivation_index - 1, &resume_index, num_found_items, 1U); + getPreviousPositionItems(_inactivation_index, &resume_index, num_found_items, 1U); if (num_found_items == 1U) { // The mission we are resuming had camera triggering enabled. In order to not lose any images