Skip to content

Conversation

DavidG-Develop
Copy link
Contributor


Basic Info

Depends on #5493

Info Please fill out this column
Ticket(s) this addresses #5463 #5493
Primary OS tested on Dockerized ubuntu
Robotic platform tested on Tb4 sim
Does this PR contain AI generated software? Partially AI assisted
Was this PR description generated by AI software? Nope

Description of contribution in a few bullet points

Added bt plugin for toggling the collision monitor. The plugin wraps the BtServiceNode and calls the toggle service using nav2_msgs::srv::Toggle. The toggle control is done using a boolean input port which defines if the cm should be enabled or disabled.

Description of documentation updates required from your changes

Should be added to the Navigation plugins -> Behavior tree nodes -> Action plugin list

Description of how this change was tested

Wrote a test for it (used previous tests as template).

Tested also by implementing a rudimentary service that this plugin can call and adding this plugin into the default tree to be called.


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-*.

Copy link
Contributor

mergify bot commented Sep 18, 2025

@DavidG-Develop, 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: David G <[email protected]>
Copy link
Contributor

mergify bot commented Sep 18, 2025

@DavidG-Develop, 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

@DavidG-Develop please heed CI and the merge conflict

* @note This is an Asynchronous (long-running) node which may return a RUNNING state while executing.
* It will re-initialize when halted.
*/
class ToggleCollisionMonitorService : public BtServiceNode<nav2_msgs::srv::Toggle>
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to open a PR against docs.nav2.org to add this to the Configuration Guide, Navigation Plugins page, and Migration Guide

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I built the docs for the Configuration guide and Navigation plugins page, but I am not sure what to do in the migration guide? Also, I will wait until this gets merged so I can add the correct link inside the navigation plugins page before opening the PR towards the docs.

Copy link
Member

Choose a reason for hiding this comment

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

Basically just make a new entry for the collision monitor can be toggled on / off, and also here's a behavior tree node to do it from a BT if you choose.

P.S. you may also be interested in adding this API to the Nav2 Simple Commander so that people can also call this from the Python3 API! That would also involve updating that page for the new function as well https://docs.nav2.org/commander_api/index.html

Copy link
Contributor Author

@DavidG-Develop DavidG-Develop Sep 23, 2025

Choose a reason for hiding this comment

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

Ok, so under Kilted to L-turtle just short explanation of this and #5493 ?

For the Nav2 Simple Commander I can take a look, but I have never worked with it so I am not that familiar with the structure. It might take some time for me to implement it depending on my availability in the coming weeks. I will take a look and until the end of the week I will either confirm that I will be implementing it or that we should open an issue so someone else can pick it up.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

mergify bot commented Sep 18, 2025

This pull request is in conflict. Could you fix it @DavidG-Develop?

DavidG-Develop and others added 3 commits September 22, 2025 09:28
Signed-off-by: David G <[email protected]>
Signed-off-by: David G <[email protected]>
@DavidG-Develop
Copy link
Contributor Author

@SteveMacenski the CI fails seem not to be bound to my code, the circleCI fails on test_nav_through_poses.missing_result while ament_flake8 returns a urlopen error <urlopen error [Errno 104] Connection reset by peer. Could you check and retrigger if needed.

@SteveMacenski
Copy link
Member

SteveMacenski commented Sep 22, 2025

Retriggering CI to check on those failures. Otherwise, see above with the action item(s)

Edit: flake8 passed now - must have been a networking fluke

Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
...lugins/action/toggle_collision_monitor_service.hpp 100.00% <100.00%> (ø)
...lugins/action/toggle_collision_monitor_service.cpp 100.00% <100.00%> (ø)

... and 10 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

CI is good now - just focus on the API & docs elements and can merge!

@DavidG-Develop
Copy link
Contributor Author

@SteveMacenski The docs are waiting for this to be merged so I can grab a working link for the plugins list on the Navigation Plugins page, and I need to do the short migration guide (will be done tmrw).
I will be unavailable for some time starting on the 1st. My preference would be to merge this now while for the simple commander API, I will either open a PR if I manage to address it before leaving, or create an issue detailing what should be done so someone else can pick it up.

@SteveMacenski
Copy link
Member

SteveMacenski commented Sep 23, 2025

We cannot merge this without a docs PR unfortunately. They are merged as a pair.

Understood on the API. I’ll file a ticket to do that once we merge.

@DavidG-Develop
Copy link
Contributor Author

Ok yep understood, than for the link I will just fill it so it points to where the file should land so than https://github.com/ros-navigation/navigation2/blob/main/nav2_behavior_tree/plugins/action/toggle_collision_monitor_service.cpp and than check it once it both gets merged. Will be done tommorow.

@SteveMacenski
Copy link
Member

Sounds good! It’s easy for forgetful maintainers (I.e. me) to merge this and then forget about the docs PR or the docs PR needs fixing and gets stale so the main code isn’t documented. This point of process is mostly for the benefit to keep things 1:1 synchronized.

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