Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: ros2
Choose a base branch
from

Conversation

tomcreutz
Copy link

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.

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.

1 participant