Open AJK97 opened 1 year ago
Hi @AJK97, I also encountered the same issue today.
The problem started to occur when using the ROS Bridge with ROS2 humble and only when using the ROS Scenario Runner.
Here, both the LaneInvasionSensor and CollisionSensor are spawned.
For some reason, both of them have the same name, so the call to self.get_topic_prefix()
yields /carla/hero/front
(for role name "hero" as you stated above).
This leads to publishing the sensor events of both sensors to topic /carla/ego_vehicle/front
, which eventually leads to the error of incompatible types, as the lane invasion sensor uses the message CarlaLaneInvasionEvent
and the collision sensor uses CarlaCollisionEvent
from ros-carla-msgs.
Quick workaround would be to define a different topic name for one of the sensors. You could change line 53 of collision_sensor.py from
self.get_topic_prefix(),
to
self.get_topic_prefix() + "_collision",
to make the ROS Bridge + humble work again.
Of course this needs further investigation. But the issue rather belongs to the repository https://github.com/carla-simulator/ros-bridge.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, i keep getting this RCL error: Failed to create publisher: create_publisher() called for existing topic name rt/carla/hero/front with incompatible type carlamsgs::msg::dds::CarlaLaneInvasionEvent_, at ./src/publisher.cpp:149, at ./src/rcl/publisher.c:116. This happens every time I try to run carla ros bridge alongside the example basic agent .
anyone here has a clue why this happens ? CARLA 9.14 ROS2 Humble