Skip to content

fix(navigator): do not report the end of a mission as a storage failure [1.18] - #28537

Merged
dakejahl merged 1 commit into
PX4:release/1.18from
Saibernard:backport-1.18-mission-end
Sep 4, 2026
Merged

fix(navigator): do not report the end of a mission as a storage failure [1.18]#28537
dakejahl merged 1 commit into
PX4:release/1.18from
Saibernard:backport-1.18-mission-end

Conversation

@Saibernard

Copy link
Copy Markdown
Contributor

Backport of #28464 to release/1.18, adapted for the branch.

Skipping an exhausted DO_JUMP at the end of a mission stepped one index past the end, and the operator saw "Waypoint could not be read." at critical severity for a mission that had simply finished. The code change is the same as on main. The two new tests are written against this branch's test fixture.

…re (PX4#28464)

* fix(navigator): do not report the end of a mission as a storage failure

getNonJumpItem() walks forward past items it skips, including a DO_JUMP
that has no repeats left. When such a DO_JUMP is the last item in the
mission the walk steps one index beyond the end and calls
loadMissionItemFromCache(), which short circuits on its own bounds check
without ever touching the datamanager. The caller then took the read
failure path and told the operator:

  "Waypoint could not be read."   (mavlink_log_critical)
  "Waypoint {1} could not be read from storage"   (events, Log::Error)

so a mission that simply ran to completion reported a Critical storage
error. A mission of the form [WP, WP, WP, DO_JUMP(repeat N)] hits this on
its final pass, and the look ahead for the next position setpoint takes
the same path, so it can repeat.

Check the index against the mission bounds inside the loop, exactly as
the function already does for the index it is entered with, and return
the same quiet PX4_ERROR that an out of range index produces there.
Callers already treat that as "no further item". Genuine datamanager
failures still report as before.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* test(navigator): cover traversal past the mission bounds over an exhausted DO_JUMP

Two regression tests for getNonJumpItem entered at a DO_JUMP whose
repeats are used up. Skipping it walks the index one step outside the
mission, forward off the end and backward in front of the start. Both
must report PX4_ERROR the same quiet way an out of range entry index
does, instead of taking the storage failure path.

On unfixed code the forward case reproduces the false
"Waypoint could not be read" critical error that a mission ending in an
exhausted DO_JUMP publishes on its final pass.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

---------

Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
(cherry picked from commit bd0b15d)
@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. kind:test Adds or improves tests. scope:navigation Missions, RTL, geofence, takeoff, landing, or navigator behavior. scope:testing Unit, integration, fuzzing, or test data. labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 0 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +55  [ = ]       0    .debug_abbrev
  -0.0%      -2  [ = ]       0    .debug_info
  -0.0%      -5  [ = ]       0    .debug_line
     +33%      +1  [ = ]       0    [Unmapped]
    -0.0%      -6  [ = ]       0    [section .debug_line]
  +0.0%     +48  [ = ]       0    TOTAL

px4_fmu-v6x [Total VM Diff: -8 byte (-0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +55  [ = ]       0    .debug_abbrev
  -0.0%      -2  [ = ]       0    .debug_info
  -0.0%      -5  [ = ]       0    .debug_line
    [NEW]      +1  [ = ]       0    [Unmapped]
    -0.0%      -6  [ = ]       0    [section .debug_line]
  +0.1%      +8  [ = ]       0    [Unmapped]
  -0.0%      -8  -0.0%      -8    .text
    +2.1%      +8  +2.1%      +8    MissionBase::getNonJumpItem()
    +4.8%      +4  +4.8%      +4    FlightTask
    -0.0%      -4  -0.0%      -4    g_cromfs_image
    -0.0%     -16  -0.0%     -16    [section .text]
  +0.0%     +48  -0.0%      -8    TOTAL

Updated: 2026-09-04T02:53:23

@dakejahl
dakejahl merged commit cb57821 into PX4:release/1.18 Sep 4, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. kind:test Adds or improves tests. scope:navigation Missions, RTL, geofence, takeoff, landing, or navigator behavior. scope:testing Unit, integration, fuzzing, or test data.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants