Skip to content

Duplicate sensor names and type, causes "failed to create topic in Cyclone DDS" #636

Open
@andrewbest-tri

Description

@andrewbest-tri

When running the ROS bridge against foxy using cyclone, or galactic I suppose, I am running into a duplicate topic error.

The problem occurs when multiple sensors (or actors) try to create the same topic with a different type. I am not yet sure which sensors are creating duplicates, but we have a test that spawns one of everything and it consistently fails on sensor creation.

exception in thread Thread-1:
TraceTraceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/[OBFUSCATED]install/carla_ros_bridge/lib/python3.8/site-packages/carla_ros_bridge/actor_factory.py", line 96, in _update_thread
    self.update_available_objects()
  File "/[OBFUSCATED]install/carla_ros_bridge/lib/python3.8/site-packages/carla_ros_bridge/actor_factory.py", line 114, in update_available_objects
    self._create_object_from_actor(carla_actor)
  File "/[OBFUSCATED]install/carla_ros_bridge/lib/python3.8/site-packages/carla_ros_bridge/actor_factory.py", line 256, in _create_object_from_actor
    obj = self._create_object(carla_actor.id, carla_actor.type_id, name,
  File "/[OBFUSCATED]install/carla_ros_bridge/lib/python3.8/site-packages/carla_ros_bridge/actor_factory.py", line 403, in _create_object
    actor = ImuSensor(uid, name, parent, spawn_pose, self.node,
  File "/[OBFUSCATED]install/carla_ros_bridge/lib/python3.8/site-packages/carla_ros_bridge/imu.py", line 52, in __init__
    self.imu_publisher = node.new_publisher(Imu, self.get_topic_prefix(), qos_profile=10)
  File "/[OBFUSCATED]install/ros_compatibility/lib/python3.8/site-packages/ros_compatibility/node.py", line 175, in new_publisher
    return self.create_publisher(
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py", line 1144, in create_publisher
    publisher_capsule = _rclpy.rclpy_create_publisher(
_rclpy.RCLError: Failed to create publisher: failed to create topic, at /tmp/binarydeb/ros-foxy-rmw-cyclonedds-cpp-0.7.8/src/rmw_node.cpp:1872, at /tmp/binarydeb/ros-foxy-rcl-1.1.13/src/rcl/publisher.c:180

It's related to ros2/rmw_cyclonedds#111 but adding multiple types for a topic is definitely not supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions