Skip to content

Fixes Underwater Camera Plugin which sets the ROS2 node name statically, which doesn't allow to have multiples#23

Merged
woensug-choi merged 1 commit into
IOES-Lab:ros2from
tomcreutz:tomcreutz-fix-underwater_camera_ros2_node_name
Jun 16, 2025
Merged

Fixes Underwater Camera Plugin which sets the ROS2 node name statically, which doesn't allow to have multiples#23
woensug-choi merged 1 commit into
IOES-Lab:ros2from
tomcreutz:tomcreutz-fix-underwater_camera_ros2_node_name

Conversation

@tomcreutz
Copy link
Copy Markdown

When adding multiple underwater camera plugins to a model sdf the output throws a warning as:

[gazebo-1] [WARN] [1732716498.287779827] [rcl.logging_rosout]: Publisher already registered for node name: 'underwater_camera_node'. If this is due to multiple nodes with the same name then all logs for the logger named 'underwater_camera_node' 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.

This is caused by setting the ros node name statically. This pull request fixes that by taking the sdf sensor name as a node name. For example:

<sensor type="rgbd_camera" name="camera_front">
  <!-- other parameters -->
  <plugin
    filename="UnderwaterCamera"
    name="dave_gz_sensor_plugins::UnderwaterCamera">
    <attenuationR>0.8</attenuationR>
    <attenuationG>0.5</attenuationG>
    <attenuationB>0.2</attenuationB>
    <!-- Murky Coastal Waters -->
    <backgroundR>85</backgroundR>
    <backgroundG>107</backgroundG>
    <backgroundB>47</backgroundB>
  </plugin>
</sensor>

will result in a ros2 node name: camera_front_node.

Copy link
Copy Markdown

@woensug-choi woensug-choi left a comment

Choose a reason for hiding this comment

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

Thank you! Take the pleasure of clicking the Merge button :)

@woensug-choi woensug-choi merged commit 9f503c8 into IOES-Lab:ros2 Jun 16, 2025
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