Skip to content

Conversation

@armgits
Copy link
Contributor

@armgits armgits commented Nov 16, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5535
Primary OS tested on Ubuntu
Robotic platform tested on --
Does this PR contain AI generated software? No
Was this PR description generated by AI software? No

Description of contribution in a few bullet points

  • Planner server can now plan partial paths when planning through poses in the presence of obstacles
  • This behavior can be enabled/disabled through a new dynamic parameter: allow_partial_planning

Description of documentation updates required from your changes

Description of how this change was tested

  • I wrote unit test to test the new behavior while planning through poses with various obstacle positions and new parameter settings. I've outputted the paths from these tests to files and manually evaluated them to ensure correctness.

Future work that may be required in bullet points

  • Parameter naming might be better
  • Exception handling and logging changes done for this feature might need to be reviewed

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-*.
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
@SteveMacenski
Copy link
Member

@armgits please take a look at the failing linting / precommit jobs. The copyright would be yours / your company's (if done for a company) if its code you wrote. If you copy+pasted it with minimum modifications from another file in Nav2, keep that original copyright.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

Do you think we shuold add a new field to the action definition that indicates if the output path is partial or not? https://github.com/ros-navigation/navigation2/blob/main/nav2_msgs/action/ComputePathThroughPoses.action

I think that would be important for an application to be aware of.

Otherwise, mostly just small things for my preference for conciseness!

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
@SteveMacenski
Copy link
Member

SteveMacenski commented Nov 17, 2025

LGTM! I think the new Action API field is the only missing element (+ the BT node to parse it to put in an output port; 3 lines)

@armgits
Copy link
Contributor Author

armgits commented Nov 17, 2025

Do you think we shuold add a new field to the action definition that indicates if the output path is partial or not?

I was thinking if adding a new error code could do the same thing... Otherwise adding a new field to the result works too, I'm fine with either way to indicate a partial path in result.

(+ the BT node to parse it to put in an output port; 3 lines)

So is the job of this BT node just to evaluate whether the result from planner server is partial?
I'm guessing there's already a BT Node that just needs to be modified.

@SteveMacenski
Copy link
Member

SteveMacenski commented Nov 17, 2025

If the setting is 'true' that it is value to return a partial one, then I think that's not an error code-situation (i.e. a failure). I think we should add a field if a partial one was used and/or maybe even include the index of the goals that the final output represents?

I'm guessing there's already a BT Node that just needs to be modified.

Yeah, just use the outputPort method in the terminal conditions to parse the value (or reset in case of error) -- you'll see in the ComputePathThroughPoses BT node, its no biggie

@armgits
Copy link
Contributor Author

armgits commented Nov 17, 2025

I think we should add a field if a partial one was used and/or maybe even include the index of the goals that the final output represents?

So this would be a boolean field to indicate partial plan + a list of indices in the order of poses given in goal request? Would the final index just before obstacle work instead?

@mergify
Copy link
Contributor

mergify bot commented Nov 17, 2025

@armgits, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@SteveMacenski
Copy link
Member

So this would be a boolean field to indicate partial plan + a list of indices in the order of poses given in goal request? Would the final index just before obstacle work instead?

I think just the final index would work. Optionally: you could have this in a single field for the index of the goal -- whereas its set to -1 when it includes all goals. It could be an enum in the message definition like these https://github.com/ros-navigation/navigation2/blob/main/nav2_msgs/action/ComputePathThroughPoses.action#L11 (obviously needs to be signed) which can be set by default and overrided only when the failure condition happens.

Then any use case of this can just check if whatever-final-goal-variable != ComputePathThroughPoses::Result::ALL_GOALS to see if its not inclusive of all, rather than storing duplicate information in the Result message

@armgits
Copy link
Contributor Author

armgits commented Nov 17, 2025

you could have this in a single field for the index of the goal -- whereas its set to -1 when it includes all goals. It could be an enum in the message definition

This sounds perfect, I'll add this field to the action API.

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
@mergify
Copy link
Contributor

mergify bot commented Nov 17, 2025

@armgits, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
…lbacks

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
@mergify
Copy link
Contributor

mergify bot commented Nov 18, 2025

@armgits, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
@mergify
Copy link
Contributor

mergify bot commented Nov 18, 2025

@armgits, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

Otherwise, assuming the tests cover the code sufficiently, this looks good to me! Just some touch up details and this is good to ship 🚢

armgits and others added 2 commits November 18, 2025 12:30
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
@SteveMacenski
Copy link
Member

@armgits check out the docs PR, I asked for a small change there and otherwise once CI passes we can merge!

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ugins/action/compute_path_through_poses_action.cpp 60.00% 2 Missing ⚠️
nav2_planner/src/planner_server.cpp 95.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
...ugins/action/compute_path_through_poses_action.hpp 100.00% <100.00%> (ø)
nav2_planner/src/planner_server.cpp 92.98% <95.00%> (+0.05%) ⬆️
...ugins/action/compute_path_through_poses_action.cpp 72.97% <60.00%> (-2.03%) ⬇️

... and 8 files with indirect coverage changes

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

SteveMacenski commented Nov 18, 2025

Just waiting on doc updates! CI's happy

@SteveMacenski SteveMacenski merged commit b41d757 into ros-navigation:main Nov 18, 2025
15 of 16 checks passed
decwest pushed a commit to decwest/navigation2 that referenced this pull request Dec 10, 2025
…through poses (ros-navigation#5687)

* Added a new state variable to track whether partial planning is allowed

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added partial planning parameter

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated unit test with partial planning parameter

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added support for planning partial paths when planning through poses

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added a new unit test for planning through poses

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added partial planning parameter

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated assertions in test cases to prevent segfaults

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated copyright

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Disable partial planning by default

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Trimmed empty lines

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added a new line at the end of file

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added a new result field for last reached pose index to the action

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated BT node with last reached pose index field

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Reduced line length for formatting

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Fixed last reachable index calculation

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added placeholder value for last_reached_index field in remaining callbacks

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Set default value for last_reached_index field

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added description for ALL_GOALS enum

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added  output port in ComputePathThroughPoses

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

---------

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
decwest pushed a commit to decwest/navigation2 that referenced this pull request Dec 11, 2025
…through poses (ros-navigation#5687)

* Added a new state variable to track whether partial planning is allowed

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added partial planning parameter

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated unit test with partial planning parameter

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added support for planning partial paths when planning through poses

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added a new unit test for planning through poses

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added partial planning parameter

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated assertions in test cases to prevent segfaults

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated copyright

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Disable partial planning by default

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Trimmed empty lines

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added a new line at the end of file

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added a new result field for last reached pose index to the action

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Updated BT node with last reached pose index field

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Reduced line length for formatting

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Fixed last reachable index calculation

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added placeholder value for last_reached_index field in remaining callbacks

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Set default value for last_reached_index field

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added description for ALL_GOALS enum

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

* Added  output port in ComputePathThroughPoses

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>

---------

Signed-off-by: Abhishekh Reddy <helloarm@pm.me>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Signed-off-by: Decwest <fumiyaonishi1016@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants