Skip to content

SebastianHuch/ros-bridge

 
 

Repository files navigation

ROS/ROS2 bridge for CARLA simulator

Actions Status Documentation GitHub GitHub release (latest by date)

This ROS package is a bridge that enables two-way communication between ROS and CARLA. The information from the CARLA server is translated to ROS topics. In the same way, the messages sent between nodes in ROS get translated to commands to be applied in CARLA.

rviz setup

This version requires CARLA 0.9.12

Features

  • Provide Sensor Data (Lidar, Semantic lidar, Cameras (depth, segmentation, rgb, dvs), GNSS, Radar, IMU)
  • Provide Object Data (Transforms (via tf), Traffic light status, Visualization markers, Collision, Lane invasion)
  • Control AD Agents (Steer/Throttle/Brake)
  • Control CARLA (Play/pause simulation, Set simulation parameters)

Getting started and documentation

Installation instructions and further documentation of the ROS bridge and additional packages are found here.


Install ROS bridge

mkdir -p ~/carla-ros-bridge && cd ~/carla-ros-bridge git clone --recurse-submodules https://github.com/SebastianHuch/ros-bridge.git src/ros-bridge rosdep update rosdep install --from-paths src --ignore-src -r colcon build --packages-ignore pcl_recorder

CARLA SERVER

./CarlaUE4.sh -quality-level=Low -ResX=500 -ResY=500

CARLA CLIENT

foxy + carla 0.9.12

source /opt/ros/foxy/setup.bash && export CARLA_ROOT=/opt/carla-simulator && export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.12-py3.7-linux-x86_64.egg:$CARLA_ROOT/PythonAPI/carla:/home/sim/venv/carla0912/lib/python3.8/site-packages && cd ~/carla-ros-bridge/ && source install/setup.bash

galactic + carla 0.9.12

source /opt/ros/galactic/setup.bash && export CARLA_ROOT=/opt/carla-simulator && export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.12-py3.7-linux-x86_64.egg:$CARLA_ROOT/PythonAPI/carla:/home/sim/venv/carla0912/lib/python3.8/site-packages && cd ~/carla-ros-bridge/ && source install/setup.bash

galactic + carla 0.9.13

source /opt/ros/galactic/setup.bash && export CARLA_ROOT=/opt/carla-simulator && export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.13-py3.7-linux-x86_64.egg:$CARLA_ROOT/PythonAPI/carla:/home/sim/venv/carla/lib/python3.8/site-packages && cd ~/carla-ros-bridge/ && source install/setup.bash

Launch Bridge (always needed). Can be launched on HIL (same machine as carla server) or on local laptop ("client")

ros2 launch carla_ros_bridge carla_ros_bridge.launch.py timeout:=10.0

Spawn objects (ego vehicle + sensors are launched). Can be launched on HIL (same machine as carla server) or on local laptop ("client")

ros2 launch carla_spawn_objects carla_spawn_objects.launch.py spawn_point_ego_vehicle:="spawn_point_ego_vehicle"

Launch pygame for ego vehicle control. Can only be launched on local laptop because of pygame display restrictions.

add carla venv to PYTHONPATH first and source carla venv:

export PYTHONPATH=$PYTHONPATH:/home/sebastian/Code/venv/carla/lib/python3.8/site-packages && source /home/sebastian/Code/venv/carla/bin/activate

ros2 launch carla_manual_control carla_manual_control.launch.py

About

ROS bridge for CARLA Simulator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 83.3%
  • C++ 11.2%
  • CMake 4.2%
  • Other 1.3%