Skip to content

Carla 0.9.16 Ubuntu ROS2 topic with double slash #9278

@FriedrichZimmer

Description

@FriedrichZimmer

Setup
Describe the setup you are using to run CARLA along with its version:

  • CARLA version: 0.9.16 Release version
  • Platform: Ubuntu 22.04
  • Python version: 3.10.12
  • GPU: Nvidia Quadro P4000
  • GPU Drivers: Don't know

Describe the bug
When attaching a ROS2 camera to a vehicle the published topic is having a double slash // in its name.
Because of the double slash I cannot visualize those images in rviz, lichtblick and "ros2 topic echo".

Steps to reproduce
I spawned a vehicle in town and attached a RGB camera and enabled ROS with
camera_bp = blueprint_library.find('sensor.camera.rgb')
camera = world.spawn_actor(camera_bp, transform, attach_to=vehicle)
camera.enable_for_ros()

with "ros2 topic list" I can see that the following two new topics have been created:
/carla//actor107/camera_info
/carla//actor107/image

in the command name the following command:
"ros2 topic echo /carla//actor107/image"
fails with the following error:
xmlrpc.client.Fault: <Fault 1: "<class 'rclpy.exceptions.InvalidTopicNameException'>:Invalid topic name: topic name must not contain repeated '/':\n '/carla//actor107/image'\n ^">

I renamed the topic with:
camera_bp.set_attribute('ros_name', '01_default_new')
but this just resalted in the same error:
/carla//01_default_new/camera_info
/carla//01_default_new/image

Expected behavior
The ROS2 topic names should be:
/carla/actor107/camera_info
/carla/actor107/image

Logs
Not found in the specified location.

Scripts
See above

Screenshots
Image

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