Part 3: Installing the CARLA ROS2 Bridge

BBBB
1 min read

This is where the magic happens – connecting your ROS2 world with our CARLA simulator! We'll download and build the carla-ros-bridge from its repository.

Navigate to /~ and clone the bridge repository:

cd ~
sudo git clone --recurse-submodules https://github.com/ttgamage/carla-ros-bridge.git

Using --recurse-submodules is important as the bridge might depend on other sub-projects.

Install colcon and rosdep: These are essential tools for building ROS2 packages and managing their dependencies.

sudo apt install python3-colcon-core python3-rosdep2 python3-colcon-common-extensions -y

Update rosdep and install dependencies: rosdep helps us find and install system dependencies for ROS packages.

rosdep update
rosdep install --from-paths carla-ros-bridge --ignore-src -r

Build the CARLA ROS2 Bridge: Finally, we use colcon to build the bridge. This compiles the code and sets up the necessary files for ROS2 to recognize and use it.

cd ~/carla-ros-bridge
colcon build

This colcon build command might take some time, as it compiles all the components of the bridge.

And just like that, we've reached another significant milestone in our autonomous vehicle journey! We've now successfully installed ROS2 Humble and the crucial CARLA ROS2 Bridge. Our environment is fully set up for us to start integrating the "brain" (ROS2) with the "body" (CARLA simulator)!

0
Subscribe to my newsletter

Read articles from BB directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

BB
BB