Skip to content

Add max_lookahead_distance parameter to path validation#6027

Merged
SteveMacenski merged 3 commits intoros-navigation:mainfrom
botsandus:validate-path-max-lookahead
Apr 9, 2026
Merged

Add max_lookahead_distance parameter to path validation#6027
SteveMacenski merged 3 commits intoros-navigation:mainfrom
botsandus:validate-path-max-lookahead

Conversation

@tonynajjar
Copy link
Copy Markdown
Contributor

@tonynajjar tonynajjar commented Mar 12, 2026


Basic Info

Info Please fill out this column
Ticket(s) this addresses None
Primary OS tested on Ubuntu
Robotic platform tested on Dexory simulation
Does this PR contain AI generated software? (No; Yes and it is marked inline in the code)
Was this PR description generated by AI software? Out of respect for maintainers, AI for human-to-human communications are banned

Description of contribution in a few bullet points

  • Added a new input port max_lookahead_distance to the ValidatePath behavior tree node, allowing users to specify how far ahead along the path to validate. (-1 means validate the full path) * Introduced a new field max_lookahead_distance in the IsPathValid service request definition to support this feature
  • Updated the ValidatePath node implementation to read and forward the max_lookahead_distance input to the service request
  • Modified the path validation logic in the planner to only check poses up to the specified lookahead distance, improving efficiency when full path validation is not necessary

Description of documentation updates required from your changes

Description of how this change was tested

  • I have a BT that replans when the path is no longer valid so I checked that it only replanned once the robot is at max_lookahead_distance from the obstacle and not earlier

Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

@tonynajjar
Copy link
Copy Markdown
Contributor Author

tonynajjar commented Mar 12, 2026

I'm realizing that check_full_path is now confusing with the presence of max_lookahead_distance and should probably be renamed to stop_at_first_collision with a default of true. @SteveMacenski Agree? Will need to be added to migration guide

@SteveMacenski
Copy link
Copy Markdown
Member

I agree that is now confusing. Sure, that name makes sense. Make sure to check this in the unit tests for ispathvalid and add a docs PR

@SteveMacenski
Copy link
Copy Markdown
Member

@tonynajjar what's the story here? I think this was largely done just needed the final details for merging

@tonynajjar
Copy link
Copy Markdown
Contributor Author

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
...avior_tree/plugins/action/validate_path_action.hpp 100.00% <100.00%> (ø)
...avior_tree/plugins/action/validate_path_action.cpp 92.68% <100.00%> (+0.37%) ⬆️
...ner/include/nav2_planner/is_path_valid_service.hpp 85.39% <100.00%> (+0.86%) ⬆️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tonynajjar tonynajjar requested a review from SteveMacenski April 9, 2026 09:38
@SteveMacenski SteveMacenski merged commit 1cbe60e into ros-navigation:main Apr 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants