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 <pavelgu@gmail.com>
This commit is contained in:
Pavel Guzenfeld 2026-03-22 08:16:04 +02:00 committed by Ramon Roche
parent b412796fc7
commit 348a558a15

View File

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