Skip to content

Logger node gets duplicate name when setting node name in launch file #3660

@cwit-vcas

Description

@cwit-vcas

Description

When using move it in a node and setting the node name in the launch file the internal move it logging node gets the same name, causing this warning to be printed.

Publisher already registered for node name: 'node_name'. If this is due to multiple nodes with the same name then all logs for the logger named 'node_name' will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.

I am not sure what the implications of this is, but we have solved a similar issue with just using the rclcpp::Logger with a name directly in a global function. Why do you need to create it from a node?

This happens on kilted not rolling, but I could not pick that option. Same goes for RMW, I use Zenoh.

ROS Distro

Rolling

OS and version

Ubuntu 24.04

Source or binary build?

Binary

If binary, which release version?

2.14.1-1noble.20251207

If source, which branch?

No response

Which RMW are you using?

None

Steps to Reproduce

Use moveit in a c++ node, change the name of node in a launch file when launching it.
In my case I specifically use: robot_model_loader::RobotModelLoader.

Expected behavior

There should be no nodes with duplicate names, and no warnings.

Actual behavior

Moveit creates its own internal logging node which gets a duplicate name and prints this warning:

Publisher already registered for node name: 'node_name'. If this is due to multiple nodes with the same name then all logs for the logger named 'node_name' will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.

If I use ros2 node list I also get this warning:

WARNING: Be aware that there are nodes in the graph that share an exact name, which can have unintended side effects.

Backtrace or Console output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions