Skip to content

Discover agents via Nav2 nodes#38

Open
xiyuoh wants to merge 2 commits into
epic/next-gen-basefrom
xiyu/nav2_participant
Open

Discover agents via Nav2 nodes#38
xiyuoh wants to merge 2 commits into
epic/next-gen-basefrom
xiyu/nav2_participant

Conversation

@xiyuoh

@xiyuoh xiyuoh commented Jul 9, 2026

Copy link
Copy Markdown
Member

Currently the Nav2Traffic plugin agent spawning is hardcoded (i.e. robot0 and robot1). This PR switches it to discover any Nav2 nodes running and extracting agent names to spawn entities with Nav2Agent components accordingly. Specifically it looks for nodes with the bt_navigator suffix, which I thought should be identifiable enough.

GenAI Use

We follow OSRA's policy on GenAI tools

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Generated-by: Gemini 3.1 Pro

Signed-off-by: Xiyu Oh <xiyuoh@gmail.com>
@xiyuoh
xiyuoh requested a review from arjo129 July 9, 2026 16:28
@mxgrey mxgrey added this to PMC Board Jul 9, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in PMC Board Jul 9, 2026

@arjo129 arjo129 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for these changes!

I think its a great idea to be able to automatically discover participants (like we do in rmf_participant_discover). However, I would caution against using node names since its super easy to remap them.

I would also caution against looking for bt_navigator fields.

The recommended way to handle this via the spec is here:

* `~/destination/path` (Path Component) - [`nav_msgs/Path.msg`](https://github.com/ros2/common_interfaces/blob/rolling/nav_msgs/msg/Path.msg): Specify a path that the robot intends to take to its destination

The challenge is to figure out which "agents" are configured via nav2. Right now this plugin will clone anything with a bt_navigator running.

Before moving further with this I want to know what your thoughts are about the over architecture of where nav2_traffic sits. Are we looking at

 flowchart TD
    A[Plan Executor] -->|~/safe_zone| B(nav2_traffic)
   
    subgraph On Nav2 Robot
        B --> C[Nav2]
    end
Loading

Or

 flowchart TD
    subgraph On Cloud/edge/buzz-word for some server
       A[Plan Executor] -->|~/safe_zone| B(nav2_traffic)
     end
    
    B --> C[Nav2]
Loading

If its the former a simple config file based approach would be preferred, IMO, the base robot may not even have nodes/topics remapped to its own name. Perhaps we would simply run one instance of the nav2_traffic plugin per robot.

We could alternatively use the latter approach. The challenge is we would have to forward ALL nav2 topics. IMO as nav2 evolves these could potentially change and it would mean maintaining a mapping (right now I think we just forward Odom).

@mxgrey mxgrey moved this from Inbox to In Review in PMC Board Jul 14, 2026
Signed-off-by: Xiyu Oh <xiyuoh@gmail.com>
@xiyuoh

xiyuoh commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@arjo129 thanks for your suggestion, agreed! As discussed during the last PMC call, updated the agent registration on the nav2 node via a config. Deliberately left the config as bare as possible, in case we have other useful fields to add in the future.

@xiyuoh
xiyuoh requested a review from arjo129 July 16, 2026 02:38

@arjo129 arjo129 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For now this looks good to me. Im wondering if we should consider a version where we have one nav2 plugin per robot


fn main() {
let args: Vec<String> = std::env::args().collect();
let config_path = args

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we consider using https://docs.rs/clap/latest/clap/

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants