Skip to content

refactor: change style of plugin names#5793

Open
AJedancov wants to merge 9 commits intoros-navigation:mainfrom
AJedancov:refactor/plugin-names
Open

refactor: change style of plugin names#5793
AJedancov wants to merge 9 commits intoros-navigation:mainfrom
AJedancov:refactor/plugin-names

Conversation

@AJedancov
Copy link
Copy Markdown
Contributor

@AJedancov AJedancov commented Dec 17, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5696
Primary OS tested on Ubuntu 24.04.3
Robotic platform tested on Turtlebot3 in Gazebo
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

  • Plugin names have been changed to match the general style. The changes affected:

    • Configuration files
    • Default plugin names (ids)
    • Plugin names in behavior trees
    • Plugin names in test files
    • Corresponding README files
  • The text of logs and comments related to changed plugin names were also brought to a common format.

Description of documentation updates required from your changes

Nav2 documentation, code examples and configuration files.

Description of how this change was tested

  • Tested locally using colcon test.

Future work that may be required in bullet points

Below are the names of parameters associated with plugins that haven't been changed. They may be changed in the future if corresponding changes are made to how names are used when creating topics, action and services.

  • Plugin names for behavior_server . These name id's are used as action servers names and therefore must comply with the current naming style.
behavior_plugins:
["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"]
  • Plugins for local_costmap and global_costmap. Plugin names are used as topics names when creating publishers (Costmap2DPublisher).
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
  • Filters for local_costmap and global_costmap. Filter names are used as service names.
filters: ["keepout_filter", "speed_filter"]
  • Plugins for bt_navigator.
    These plugin names in parameter files are not used when configuring groot. Instead, groot configuration uses default names like "navigate_to_pose" which are defined in the plugins themselves.
    And if the names will be changed only in the configuration files, then at the plugin configuration stage will be implicitly created duplicate parameters with default names. On the other hand, we can't change the default names in plugins since they are also used as services names.
navigators: ["navigate_to_pose", "navigate_through_poses"]

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

@AJedancov
Copy link
Copy Markdown
Contributor Author

I will try to implement the changes described above to complete the task. Since the current changes affect the entire project, I think it would be easier for the review to separate them as new PR referencing this one to keep everything a little cleaner. What do you think?

@SteveMacenski
Copy link
Copy Markdown
Member

Please rebase / pull in main to fix CI. We've updated some cache keys and rebalanced our pipeline recently

Copy link
Copy Markdown
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.

We need the corresponding docs PR, but nothing here I object to. @mini-1235 can you look at this and make sure we didn't miss any default setting update in the code, BT XML default IDs to be updated

@SteveMacenski
Copy link
Copy Markdown
Member

On your open items: maybe we should invert these to be all snake_case then if we're having behavior tied this way. I don't like the idea of having topic names changed, especially to use CamelCase since that's an antipattern for topic naming.

We could force snake_case the plugin names for topic naming, but that seems like trying to make it harder for ourselves.

@AJedancov AJedancov force-pushed the refactor/plugin-names branch from e9be492 to a287086 Compare December 18, 2025 08:05
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
...tree/plugins/action/goal_checker_selector_node.hpp 100.00% <ø> (ø)
.../plugins/action/progress_checker_selector_node.hpp 100.00% <ø> (ø)
...2_collision_monitor/src/collision_monitor_node.cpp 97.01% <100.00%> (ø)
nav2_controller/src/controller_server.cpp 80.05% <ø> (ø)
nav2_costmap_2d/plugins/obstacle_layer.cpp 81.93% <ø> (ø)
nav2_planner/src/planner_server.cpp 93.54% <100.00%> (ø)
nav2_route/src/edge_scorer.cpp 100.00% <100.00%> (ø)
nav2_route/src/graph_loader.cpp 100.00% <100.00%> (ø)
nav2_route/src/operations_manager.cpp 100.00% <100.00%> (ø)
...src/plugins/edge_cost_functions/costmap_scorer.cpp 100.00% <ø> (ø)
... and 2 more

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

Copy link
Copy Markdown
Collaborator

@mini-1235 mini-1235 left a comment

Choose a reason for hiding this comment

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

I think this also needs to be updated

primary_controller_->configure(parent, name + ".primary_controller", tf, costmap_ros);

@AJedancov
Copy link
Copy Markdown
Contributor Author

AJedancov commented Dec 18, 2025

I don't like the idea of having topic names changed, especially to use CamelCase

I agree with you and tried to avoid this during the change process. Currently, I see several ways how this can be achieved further:

  1. Implement additional methods in the plugins themselves that will return snake_case names when creating topics.

As an example, I have seen how this has already been implemented in behavior_tree_navigator.hpp

bt_action_server_ =
std::make_unique<nav2_behavior_tree::BtActionServer<ActionT, nav2::LifecycleNode>>(
node,
getName(),

There is used a virtual method:

virtual std::string getName() = 0;

And each plugin override it according to its name:

std::string getName() override {return std::string("navigate_to_pose");}

std::string getName() override {return std::string("navigate_through_poses");}

This way we can decouple the names from the configuration files and the names used for topics, action or services.
If you agree, I can begin implementation and I'll come back here if there are other pitfalls.

  1. As you mentioned, we can actually bring all the names related to plugins to snake_case. And this will require reverting all current changes and changing other part of the plugin names that already had CamelCase style.
    On the positive side, this will help avoid potential side effects associated with topic naming now or in the future. And I think this is also a good option, since during testing I already encountered mixed service names:
/route_server/DynamicEdgesScorer/adjust_edges  
/route_server/ReroutingService/reroute
...
/fromLL

And I could fix them at the same time.

@SteveMacenski
Copy link
Copy Markdown
Member

As you mentioned, we can actually bring all the names related to plugins to snake_case. And this will require reverting all current changes and changing other part of the plugin names that already had CamelCase style.  On the positive side, this will help avoid potential side effects associated with topic naming now or in the future. And I think this is also a good option, since during testing I already encountered mixed service names:

I think this is the right direction to go! :-)

@AJedancov
Copy link
Copy Markdown
Contributor Author

I have prepared the new changes as discussed above, which include:

  • Reverted changes from the previous commit. I have kept only a few comments and log messages.
  • Changed style for the rest of plugin names from CamelCase to snake_case.
  • Changed names of the services I mentioned above. The only service name that was not changed is fromLL, as the server is declared in the robot_localisation package, and we subscribe to it.

As before, the new changes were tested locally using colcon test and pre-commit (except ament_mypy as mentioned in one of the recent issues).

The only thing I want to note is that the names for critics (for MPPI and DWB controllers) also belong to plugins, but at the moment they cannot be changed since they are directly used as lookup_name for pluginlib::ClassLoader and must match the class names.

auto instance = std::unique_ptr<critics::CriticFunction>(
loader_->createUnmanagedInstance(fullname));

TrajectoryCritic::Ptr plugin = critic_loader_.createUniqueInstance(plugin_class);

I also have a couple points to discuss. I know this doesn't apply to plugins, but the following names stand out too:

  • polygons names for collision_monitor
    polygons: ["FootprintApproach"]
    FootprintApproach:
  • TrajectoryVisualizer and AckermannConstraints for controller_server
      TrajectoryVisualizer:
        trajectory_step: 5
        time_step: 3
      trajectory_validator:
        plugin: "mppi::DefaultOptimalTrajectoryValidator"
        collision_lookahead_time: 2.0  
        consider_footprint: false
      AckermannConstraints:
        min_turning_r: 0.2

Would you also consider replacing them?

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jan 8, 2026

This pull request is in conflict. Could you fix it @AJedancov?

Copy link
Copy Markdown
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.

The biggest thing here is going to be the Migration guide to explain to people where and how to make the changes. Please detail all of the snake_case changed values explicitly in a bulleted list and link back to this PR as an example with the migrated yaml file.

This is a large, breaking change, so any detail you think is important to help someone go from A->B would be great.

Also, we need to update to snake_case in the docs / tutorials / configuration guides as well

There's a few merge conflicts now that should be addressed

Overall, very good! 😄

@SteveMacenski
Copy link
Copy Markdown
Member

The only thing I want to note is that the names for critics (for MPPI and DWB controllers) also belong to plugins, but at the moment they cannot be changed since they are directly used as lookup_name for pluginlib::ClassLoader and must match the class names.

OK!

polygons names for collision_monitor

That's just a parameterized dynamic namespace, not a plugin. This can be changed though and not a problem.

TrajectoryVisualizer and AckermannConstraints for controller_server

These are simply nested namespaces for the parameters (no plugins, no dynamic sizing, etc), so I think these should just stay as-is.

@SteveMacenski SteveMacenski linked an issue Jan 8, 2026 that may be closed by this pull request
@AJedancov
Copy link
Copy Markdown
Contributor Author

AJedancov commented Jan 8, 2026

Also, we need to update to snake_case in the docs / tutorials / configuration guides as well

Sure! I was planning to do that after this PR.

There's a few merge conflicts now that should be addressed

I've resolved them locally for now.

Overall, very good! 😄

Thanks for the review!

@AJedancov AJedancov force-pushed the refactor/plugin-names branch from eba20e3 to b48ac7d Compare January 10, 2026 17:34
@AJedancov
Copy link
Copy Markdown
Contributor Author

AJedancov commented Jan 10, 2026

The last few commits include:

  • Reverted changes from the comments above.
  • Changed names for polygons.
  • Changed observation_sources names in some tests to match the names in existing config files.

@AJedancov AJedancov marked this pull request as ready for review January 10, 2026 18:45
Copy link
Copy Markdown
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.

I think just the documentation updates I mentioned are left! Those are pretty important here since this is a big change that everyone's going to need to make. I would put this towards the top of the migration guide page (and make sure to update all the yaml/examples in the docs as well to match the code)

@AJedancov
Copy link
Copy Markdown
Contributor Author

I think just the documentation updates I mentioned are left! Those are pretty important here since this is a big change that everyone's going to need to make.

I am currently working on this. And while changing the documentation, I noticed that there is a shapes parameter for vector_object_server. I suppose this can also be changed in a similar way to polygons?

vector_object_server:
ros__parameters:
map_topic: "vo_map"
global_frame_id: "map"
resolution: 0.05
default_value: -1
overlay_type: 0
update_frequency: 1.0
transform_tolerance: 0.1
shapes: ["Poly", "Circle"]
Poly:
type: "polygon"
frame_id: "map"
closed: true
value: 100
points: [0.3, 0.5, -0.4, 1.2, -0.4, -0.2]
Circle:
type: "circle"
frame_id: "map"
fill: true
value: 100
center: [1.5, 0.5]
radius: 0.7

@AJedancov AJedancov marked this pull request as draft January 13, 2026 17:41
@SteveMacenski
Copy link
Copy Markdown
Member

SteveMacenski commented Jan 13, 2026

Sure :-)

Anymore? 😆

@AJedancov
Copy link
Copy Markdown
Contributor Author

Anymore? 😆

Who knows 😄 Maybe it's really better to leave it unmerged for now while I update the docs, in case anything else comes up.

Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Keep comments and log messages intact

Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
@AJedancov AJedancov force-pushed the refactor/plugin-names branch from 4447641 to 75e37a5 Compare January 16, 2026 16:59
@AJedancov
Copy link
Copy Markdown
Contributor Author

I have opened PR ros-navigation/docs.nav2.org#854 for the documentation as you mentioned above, including information for migration guide. So if any improvements are needed, we can continue there.

Additionally, the latest commit here updates some names in the behavior tree configurations for tests so they match their BT node names.

@AJedancov AJedancov marked this pull request as ready for review January 16, 2026 18:45
@SteveMacenski
Copy link
Copy Markdown
Member

@mini-1235 please sanity check that you don't see any more gaps :-)

Copy link
Copy Markdown
Collaborator

@mini-1235 mini-1235 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Inconsistent plugin naming

3 participants