Skip to content

fix(navigator): goToNextPositionItem skip loops when required#26993

Open
JonasPerolini wants to merge 8 commits intoPX4:mainfrom
JonasPerolini:pr-fix-rtl-loops
Open

fix(navigator): goToNextPositionItem skip loops when required#26993
JonasPerolini wants to merge 8 commits intoPX4:mainfrom
JonasPerolini:pr-fix-rtl-loops

Conversation

@JonasPerolini
Copy link
Copy Markdown
Contributor

As a first step for: #26973 as discussed with @mrpollo, this PR ensures that goToNextPositionItem(bool execute_jump) uses the execute_jump input.

This fixes the init of RTL_MISSION_FAST_REVERSE in a very specific edge case where the first position item is a loop. RTL now picks the correct starting waypoint if no previous waypoint exists.

This PR also unifies the calls to _dataman_cache.loadWait with a new helper function: loadMissionItemFromCache which checks the index inputs. Note that the _dataman_client.readSync from resetMissionJumpCounter was updated to use loadMissionItemFromCache as well.


Tested with new unit tests: make tests TESTFILTER=test_mission_base


Side note: a new enum class:

	enum class MissionTraversalType : uint8_t {
		FollowMissionControlFlow = 0,
		IgnoreDoJump,
	};

is added to clarify the function calls and simplify the code reading e.g. goToItem(_mission.land_start_index, false) becomes goToItem(_mission.land_start_index, MissionTraversalType::IgnoreDoJump))

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors MissionBase mission-item traversal to make DO_JUMP handling explicit (via a new MissionTraversalType) and fixes an RTL fast-reverse edge case where an initial DO_JUMP loop could prevent selecting the correct first position waypoint. It also centralizes dataman cache reads via a loadMissionItemFromCache() helper and adds unit tests covering the new traversal semantics.

Changes:

  • Replace the execute_jump boolean with MissionTraversalType and update mission/RTL call sites accordingly.
  • Add loadMissionItemFromCache(), plus findNext/PreviousPositionIndex() helpers, and refactor traversal helpers to use them.
  • Add navigator mission traversal unit tests and integrate them into the build.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/modules/navigator/mission_base.h Introduces MissionTraversalType, new traversal helper APIs, and loadMissionItemFromCache() interface.
src/modules/navigator/mission_base.cpp Refactors traversal logic to respect traversal type and unifies dataman cache reads through a helper.
src/modules/navigator/mission.cpp Updates mission progression/index-setting calls to use MissionTraversalType.
src/modules/navigator/rtl_mission_fast.cpp Updates next-item traversal call to use MissionTraversalType.
src/modules/navigator/rtl_mission_fast_reverse.cpp Uses IgnoreDoJump when bootstrapping reverse RTL from “no prior position item” state; keeps legacy traversal elsewhere.
src/modules/navigator/rtl_direct_mission_land.cpp Updates item selection/progression calls to use MissionTraversalType.
src/modules/navigator/rtl_params.yaml Updates RTL_TYPE descriptions to mention skipping DO_JUMP/non-position items in reverse-path modes.
docs/en/flight_modes/return.md Updates Return-mode docs for reverse RTL behaviour (DO_JUMP handling) and adds the leading-loop edge case note.
src/modules/navigator/CMakeLists.txt Adds the navigator test subdirectory to the build.
src/modules/navigator/test/CMakeLists.txt Adds navigator functional gtest target.
src/modules/navigator/test/test_mission_base.cpp Adds new unit tests for MissionBase traversal helpers and traversal semantics.

Comment on lines +69 to +77
2: Return to a planned mission landing, if available, using the mission path,
else return to home via the reverse mission path. Do not consider rally
points.
else return to home via the reverse mission path while skipping DO_JUMP
and other non-position mission items. Do not consider rally points.
3: 'Return via direct path to closest destination: home, start of mission
landing pattern or safe point. If the destination is a mission landing pattern,
follow the pattern to land.'
4: Return to the planned mission landing, or to home via the reverse mission
path, whichever is closer by counting waypoints. Do not consider rally points.
path while skipping DO_JUMP and other non-position mission items, whichever
is closer by counting waypoints. Do not consider rally points.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated RTL_TYPE descriptions for values 2 and 4 state that the reverse mission path runs "while skipping DO_JUMP". In the current implementation, reverse RTL still uses goToPreviousPositionItem(MissionTraversalType::FollowMissionControlFlow) (e.g. src/modules/navigator/rtl_mission_fast_reverse.cpp:108-111), which will execute active DO_JUMP items and can change traversal order (skip waypoints). Either adjust the description to match the actual behaviour (only skipping DO_JUMP in the specific start edge case) or change reverse traversal to use IgnoreDoJump consistently.

Copilot uses AI. Check for mistakes.
- **Mission mode:**
- Mission flown "fast-backward" (in reverse) starting from the previous waypoint
- Jumps, delay and any other non-position commands ignored, loiter and other position waypoints converted to simple waypoints.
- DO_JUMP commands, delays and other non-position mission items are ignored, and loiter and other position waypoints are converted to simple waypoints.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section states that in fast-backward (reverse mission) RTL, "DO_JUMP commands ... are ignored". However, reverse RTL currently advances using goToPreviousPositionItem(MissionTraversalType::FollowMissionControlFlow) (src/modules/navigator/rtl_mission_fast_reverse.cpp:108-111), which will execute active DO_JUMP items (potentially skipping waypoints). Please update the documentation to match the actual behaviour, or switch reverse traversal to IgnoreDoJump if the intent is to ignore DO_JUMP throughout reverse RTL.

Suggested change
- DO_JUMP commands, delays and other non-position mission items are ignored, and loiter and other position waypoints are converted to simple waypoints.
- Active `DO_JUMP` commands are followed as part of the mission control flow, so reverse RTL may skip waypoints.
Delays and other non-position mission items are ignored, and loiter and other position waypoints are converted to simple waypoints.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the code I've kept the legacy behaviour which does not skip the jumps:

bool RtlMissionFastReverse::setNextMissionItem()
{
	return (goToPreviousPositionItem(true) == PX4_OK);
}

However the doc mentioned: DO_JUMP commands, delays and other non-position mission items are ignored

Should we update the doc or the logic @mrpollo?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW The docs reflect the original intent. The idea is that a mission path defines a safe path that you can follow forward or back to a safe location. However when you are RTL ing you want to return home in minimum time, so you want to avoid any programmed delays, or taking photos, or whatever.

if going forward through a mission you might have a DO_JUMP that takes you back to an earlier waypoint, you then progress forward until you get to the jump, and then repeat as many times as indicated. When reversing, you want to ignore that DO_JUMP and just follow the path back.

It is also possible while going forward through a mission that you might skip forward to a later item, skipping items in the middle (then going forward, and potentially jumping back and repeating bits etc). If you are reversing the mission I think you want to ignore these too - depending where you are it is possible you will actually traverse in reverse a waypoint you didn't encounter on your way out - but there is no way of knowing.

To summarise, I think it is safest to ingore all jumps in the mission, unless you can canonically work out a better minimum path that doesn't exit the planned mission path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps needs a little testing to verify some more complicated missions. But certainly this is better for the more common jumps, which go backwards in the mission.

Copy link
Copy Markdown
Contributor Author

@JonasPerolini JonasPerolini Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hamishwillee the way I understand loops, they are meant to target indexes lower than the current DO_JUMP point index (i.e. jump backwards) to ensure that we can repeat the loop by re-reaching the DO_JUMP. A DO_JUMP forward needs nested loops to perform the loop repetitions.

Considering this, the fastest way to get to the goal would be:

  • In reverse direction: use the DO_JUMP because we skip other waypoints (shortcut)
    • E.g. for a mission: [wp0, wp1, wp2, wp3, jump to 1, wp5], when flying reverse
      • if the jump segment is followed: wp5 -> wp1 -> wp0
      • if the jump segment is skipped: wp5 -> wp3 -> wp2 -> wp1 -> wp0
  • In nominal direction: skip the DO_JUMP because we want to reach our goal

However, when flying in fixed-wing, the reverse DO_JUMP segment might not be feasible without large deviations e.g. sharp turn because the operator never intended to fly the DO_JUMP in reverse.

Overall, I would skip jumps for both rtl_mission_fast and rtl_mission_fast_reverse because the behavior is simpler and unified and because the DO_JUMP segment can have sharp angles when flown in reverse. However, assuming that jumps are meant to jump backwards, the shortest path is to skip jumps going fowards and use the jump segment when going reverse.

What do you think?

Copy link
Copy Markdown
Contributor Author

@JonasPerolini JonasPerolini Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the implementation, it is not trivial to skip jumps. It will require some changes both in rtl and in mission_base.

We need to update getNextPositionItems to use IgnoreDoJump in:

  1. RtlMissionFast::on_activation()
  2. RtlMissionFast::setNextMissionItem()
  3. RtlMissionFast::setActiveMissionItems()

There are also other helper functions within mission_base that default to FollowMissionControlFlow:

  • checkClimbRequired
  • isLanding
  • if (_inactivation_index > 0 && cameraWasTriggering()) {
  • if (_align_heading_necessary && is_mission_item_reached_or_completed()) {

We probably need a general MissionTraversalType and both RTL modes would override it to IgnoreDoJump

We might also need to rework: reverseIsFurther

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code updated here: b396503 @hamishwillee

We now have a new method virtual MissionTraversalType traversalType() const in mission_base which can be used to decide if we skip or continue loops. Note that the helper functions such as goToPreviousItem still take as input MissionTraversalType because there are exceptions for which we don't want to follow the general traversalType().

  • E.g. MissionBase::do_abort_landing() explicitely ignores DO_JUMPS in all modes.

To ensure that the helper function calls are consistent, each function has its overload method:

  1. with MissionTraversalType used to explicitly set a traversalType e.g. do_abort_landing
  2. without MissionTraversalType as input used with the default traversalType()

I did not change reverseIsFurther because it is out of scope for this PR. Once we have #26973 and the new mission route cache with non-blocking calls we can update reverseIsFurther such that the distance is used.

Added this to the docs:

::: info
For `RTL_TYPE=4`, PX4 currently chooses between continuing to a mission landing and reversing toward home by comparing raw mission item indices.
This is only an approximation of the flown path length, because the number if mission items is not indicative of the distance remaining and non-position items are also counted.
:::

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to be able to look at this properly until next week - at this point its a technical review anyway. But

  1. because the number if mission item ... OF items.
  2. You can omit non-waypoint items possibly in the count, but the point is reasonable to add - the only way to do this properly is to calculate the actual path that will be travelled.
  3. I'd add some very complicated loops for testing. Perhaps because I'm rubbish at coding and tests are what save me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the typo: if --> of, good catch

What would be an example of some complicated loops? E.g. a loop pointing to a non-position item? Please note that there are several unit tests already for loops e.g.

// WHAT: [WP0, WP1, DO_JUMP->0, WP3] starting from idx 2 returns idx 0 then idx 1.
TEST_F(MissionBaseTraversalTest, GetNextPositionItemsFollowsActiveDoJump)
// WHAT: [WP0, WP1, DO_JUMP->0, WP3] from current_seq=3 should still land on idx 0.
TEST_F(MissionBaseTraversalTest, GoToPreviousPositionItemFollowsMissionControlFlow)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a check of a forward jump (to see if supported) and that this does indeed skip it. My general point was "for me more testing is better". If you're sure this works then do what you think is reasonable.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 280 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +280  +0.0%    +280    .text
  [NEW]     +72  [NEW]     +72    MissionBase::findNextPositionIndex()
  +0.0%     +72  +0.0%     +72    g_cromfs_image
  [NEW]     +68  [NEW]     +68    MissionBase::findPreviousPositionIndex()
  [NEW]     +52  [NEW]     +52    MissionBase::loadMissionItemFromCache()
 -100.0%     +42 -100.0%     +42    [12 Others]
  [NEW]     +40  [NEW]     +40    MissionBase::loadTraversalItem()
   +58%     +22   +58%     +22    MissionBase::goToNextItem()
   +36%     +18   +36%     +18    MissionBase::goToNextPositionItem()
   +39%     +18   +39%     +18    MissionBase::goToPreviousPositionItem()
   +16%     +16   +16%     +16    MissionBase::getNextPositionItems()
   +12%     +12   +12%     +12    MissionBase::getPreviousPositionItems()
  +9.5%      +8  +9.5%      +8    Mission
  +9.5%      +8  +9.5%      +8    MissionBase
  +8.3%      +8  +8.3%      +8    RtlBase
 -14.3%     -20 -14.3%     -20    MissionBase::checkClimbRequired()
  -3.5%     -20  -3.5%     -20    MissionBase::on_active()
 -10.6%     -20 -10.6%     -20    MissionBase::resetMissionJumpCounter()
 -25.0%     -24 -25.0%     -24    MissionBase::loadCurrentMissionItem()
 -38.9%     -28 -38.9%     -28    MissionBase::updateCachedItemsUpToIndex()
  -8.2%     -32  -8.2%     -32    MissionBase::getNonJumpItem()
 -11.3%     -32 -11.3%     -32    MissionBase::setMissionToClosestItem()
+0.0%    +258  [ = ]       0    .debug_abbrev
+0.1%    +136  [ = ]       0    .debug_aranges
+0.1%    +404  [ = ]       0    .debug_frame
+0.0% +3.32Ki  [ = ]       0    .debug_info
+0.0%    +791  [ = ]       0    .debug_line
  [DEL]      -5  [ = ]       0    [Unmapped]
  +0.0%    +796  [ = ]       0    [section .debug_line]
+0.0% +1.16Ki  [ = ]       0    .debug_loclists
+0.0%    +128  [ = ]       0    .debug_rnglists
  [NEW]      +3  [ = ]       0    [Unmapped]
  +0.0%    +125  [ = ]       0    [section .debug_rnglists]
+0.0% +1.04Ki  [ = ]       0    .debug_str
+0.1%    +824  [ = ]       0    .strtab
  [NEW]     +70  [ = ]       0    MissionBase::findNextPositionIndex()
  [NEW]     +74  [ = ]       0    MissionBase::findPreviousPositionIndex()
  +157%     +72  [ = ]       0    MissionBase::getNextPositionItems()
   +45%     +25  [ = ]       0    MissionBase::getNonJumpItem()
  +152%     +76  [ = ]       0    MissionBase::getPreviousPositionItems()
   +83%     +25  [ = ]       0    MissionBase::goToItem()
  +176%     +58  [ = ]       0    MissionBase::goToNextItem()
  +161%     +66  [ = ]       0    MissionBase::goToNextPositionItem()
   +68%     +25  [ = ]       0    MissionBase::goToPreviousItem()
  +156%     +70  [ = ]       0    MissionBase::goToPreviousPositionItem()
  [NEW]     +62  [ = ]       0    MissionBase::loadMissionItemFromCache()
  [NEW]     +83  [ = ]       0    MissionBase::loadTraversalItem()
  [NEW]     +35  [ = ]       0    MissionBase::traversalType()
  [NEW]     +38  [ = ]       0    RtlMissionFast::traversalType()
  [NEW]     +45  [ = ]       0    RtlMissionFastReverse::traversalType()
   +39%     +16  [ = ]       0    ___ZN7Mavlink16update_rate_multEv_veneer
 -38.1%     -16  [ = ]       0    __perf_set_elapsed_veneer
+0.1%    +384  [ = ]       0    .symtab
   +50%     +16  [ = ]       0    Mission::on_activation()
 -50.0%     -16  [ = ]       0    Mission::setNextMissionItem()
  [NEW]     +32  [ = ]       0    MissionBase::findNextPositionIndex()
  [NEW]     +32  [ = ]       0    MissionBase::findPreviousPositionIndex()
  +100%     +32  [ = ]       0    MissionBase::getNextPositionItems()
  +100%     +32  [ = ]       0    MissionBase::getPreviousPositionItems()
   +33%     +16  [ = ]       0    MissionBase::goToNextItem()
  +300%     +48  [ = ]       0    MissionBase::goToNextPositionItem()
  +100%     +16  [ = ]       0    MissionBase::goToPreviousItem()
   +33%     +16  [ = ]       0    MissionBase::goToPreviousPositionItem()
  [NEW]     +48  [ = ]       0    MissionBase::loadMissionItemFromCache()
  [NEW]     +32  [ = ]       0    MissionBase::loadTraversalItem()
  [NEW]     +32  [ = ]       0    MissionBase::traversalType()
 -33.3%     -16  [ = ]       0    MissionBase::updateCachedItemsUpToIndex()
 -50.0%     -16  [ = ]       0    RtlMissionFast::setNextMissionItem()
  [NEW]     +48  [ = ]       0    RtlMissionFast::traversalType()
   +50%     +16  [ = ]       0    RtlMissionFastReverse::on_active()
  [NEW]     +32  [ = ]       0    RtlMissionFastReverse::traversalType()
 -33.3%     -16  [ = ]       0    RtlMissionFastReverse::updateParamsImpl()
 -140.0%     -32  [ = ]       0    [1 Others]
   +67%     +32  [ = ]       0    ___ZN7Mavlink16update_rate_multEv_veneer
-2.8%    -280  [ = ]       0    [Unmapped]
+0.0% +8.38Ki  +0.0%    +280    TOTAL

px4_fmu-v6x [Total VM Diff: 272 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +272  +0.0%    +272    .text
  [NEW]     +72  [NEW]     +72    MissionBase::findNextPositionIndex()
  [NEW]     +68  [NEW]     +68    MissionBase::findPreviousPositionIndex()
  +0.0%     +64  +0.0%     +64    g_cromfs_image
  [NEW]     +52  [NEW]     +52    MissionBase::loadMissionItemFromCache()
 -100.0%     +42 -100.0%     +42    [12 Others]
  [NEW]     +40  [NEW]     +40    MissionBase::loadTraversalItem()
   +58%     +22   +58%     +22    MissionBase::goToNextItem()
   +36%     +18   +36%     +18    MissionBase::goToNextPositionItem()
   +39%     +18   +39%     +18    MissionBase::goToPreviousPositionItem()
   +16%     +16   +16%     +16    MissionBase::getNextPositionItems()
   +12%     +12   +12%     +12    MissionBase::getPreviousPositionItems()
  +9.5%      +8  +9.5%      +8    Mission
  +9.5%      +8  +9.5%      +8    MissionBase
  +8.3%      +8  +8.3%      +8    RtlBase
 -14.3%     -20 -14.3%     -20    MissionBase::checkClimbRequired()
  -3.5%     -20  -3.5%     -20    MissionBase::on_active()
 -10.6%     -20 -10.6%     -20    MissionBase::resetMissionJumpCounter()
 -25.0%     -24 -25.0%     -24    MissionBase::loadCurrentMissionItem()
 -38.9%     -28 -38.9%     -28    MissionBase::updateCachedItemsUpToIndex()
  -8.2%     -32  -8.2%     -32    MissionBase::getNonJumpItem()
 -11.3%     -32 -11.3%     -32    MissionBase::setMissionToClosestItem()
+0.0%    +258  [ = ]       0    .debug_abbrev
+0.1%    +136  [ = ]       0    .debug_aranges
+0.1%    +404  [ = ]       0    .debug_frame
+0.0% +3.32Ki  [ = ]       0    .debug_info
+0.0%    +799  [ = ]       0    .debug_line
   +75%      +3  [ = ]       0    [Unmapped]
  +0.0%    +796  [ = ]       0    [section .debug_line]
+0.0% +1.13Ki  [ = ]       0    .debug_loclists
+0.0%    +124  [ = ]       0    .debug_rnglists
 -50.0%      -1  [ = ]       0    [Unmapped]
  +0.0%    +125  [ = ]       0    [section .debug_rnglists]
+0.0% +1.04Ki  [ = ]       0    .debug_str
+0.1%    +824  [ = ]       0    .strtab
  [NEW]     +70  [ = ]       0    MissionBase::findNextPositionIndex()
  [NEW]     +74  [ = ]       0    MissionBase::findPreviousPositionIndex()
  +157%     +72  [ = ]       0    MissionBase::getNextPositionItems()
   +45%     +25  [ = ]       0    MissionBase::getNonJumpItem()
  +152%     +76  [ = ]       0    MissionBase::getPreviousPositionItems()
   +83%     +25  [ = ]       0    MissionBase::goToItem()
  +176%     +58  [ = ]       0    MissionBase::goToNextItem()
  +161%     +66  [ = ]       0    MissionBase::goToNextPositionItem()
   +68%     +25  [ = ]       0    MissionBase::goToPreviousItem()
  +156%     +70  [ = ]       0    MissionBase::goToPreviousPositionItem()
  [NEW]     +62  [ = ]       0    MissionBase::loadMissionItemFromCache()
  [NEW]     +83  [ = ]       0    MissionBase::loadTraversalItem()
  [NEW]     +35  [ = ]       0    MissionBase::traversalType()
  [NEW]     +38  [ = ]       0    RtlMissionFast::traversalType()
  [NEW]     +45  [ = ]       0    RtlMissionFastReverse::traversalType()
+0.1%    +384  [ = ]       0    .symtab
   +50%     +16  [ = ]       0    Mission::on_activation()
 -50.0%     -16  [ = ]       0    Mission::setNextMissionItem()
  [NEW]     +32  [ = ]       0    MissionBase::findNextPositionIndex()
  [NEW]     +32  [ = ]       0    MissionBase::findPreviousPositionIndex()
  +100%     +32  [ = ]       0    MissionBase::getNextPositionItems()
  +100%     +32  [ = ]       0    MissionBase::getPreviousPositionItems()
   +33%     +16  [ = ]       0    MissionBase::goToNextItem()
  +300%     +48  [ = ]       0    MissionBase::goToNextPositionItem()
  +100%     +16  [ = ]       0    MissionBase::goToPreviousItem()
   +33%     +16  [ = ]       0    MissionBase::goToPreviousPositionItem()
  [NEW]     +48  [ = ]       0    MissionBase::loadMissionItemFromCache()
  [NEW]     +32  [ = ]       0    MissionBase::loadTraversalItem()
  [NEW]     +32  [ = ]       0    MissionBase::traversalType()
 -33.3%     -16  [ = ]       0    MissionBase::updateCachedItemsUpToIndex()
 -50.0%     -16  [ = ]       0    RtlMissionFast::setNextMissionItem()
  [NEW]     +48  [ = ]       0    RtlMissionFast::traversalType()
   +50%     +16  [ = ]       0    RtlMissionFastReverse::on_active()
  [NEW]     +32  [ = ]       0    RtlMissionFastReverse::traversalType()
 -33.3%     -16  [ = ]       0    RtlMissionFastReverse::updateParamsImpl()
-4.4%    -272  [ = ]       0    [Unmapped]
+0.0% +8.35Ki  +0.0%    +272    TOTAL

Updated: 2026-04-09T09:35:49

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

No broken links found in changed files.

@JonasPerolini
Copy link
Copy Markdown
Contributor Author

JonasPerolini commented Apr 9, 2026

Summary of the changes:

  • Unify the calls to _dataman_cache.loadWait with a new helper function: loadMissionItemFromCache
  • Rtl fast and rtl fast reverse now skip DO_JUMP loops
    • A new method virtual MissionTraversalType traversalType() const in mission_base can be used to decide if we skip or continue loops
  • Added unit test coverage
  • Updated the docs

Tested the PR in SIM using RTL_TYPE 2 to enter rtl_mission_fast and RTL_TYPE 4 with several mission items to force rtl_mission_fast_reverse:

  1. Loops are performed in nominal mission mode (default behavior not broken) (Item 4 jumps to item 2, 1 repetition)
MissionModeLoops.mp4
  1. Loops are skipped in rtl fast
ReturnNominal.mp4
  1. Loops are skipped in rtl fast reverse (Note that waypoints were added to ensure reverseIsFurther chooses the reverse path)
ReturnReverse.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants