This repository provides a guide for running CARLA on Ubuntu 22.xx, covering setup, dependencies, and quick launch instructions. CARLA, developed by the CVC group at the Universitat Autònoma de Barcelona (UAB), is a flexible open-source simulator for autonomous driving research. This guide builds on their work and aims to make CARLA accessible for experimentation and learning.
To quickly launch CARLA with the RaceTrack map in server mode at 30 FPS, run the following:
./CarlaUE4.sh /Game/Maps/RaceTrack -windowed -carla-server -benchmark -fps=30For detailed options and advanced configurations, refer to the official CARLA documentation.
This guide assumes a non-fresh install of Ubuntu 22.xx. It is designed to set up the necessary environment for running CARLA effectively. If you spot any errors or omissions, feel free to submit a pull request.
CARLA requires Python 3.6.x, which is not the default on Ubuntu 22.xx. Begin by updating your system and installing essential libraries:
sudo apt-get update
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev \
libgdbm-dev libnss3-dev libedit-dev libc6-dev \
libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev \
libsdl1.2-dev libsmpeg-dev libportmidi-dev ffmpeg libswscale-dev \
libavformat-dev libavcodec-dev libfreetype6-dev \
libatlas-base-dev gfortranNext, download and compile Python 3.6.15:
cd /opt
sudo curl -O https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz
sudo tar -xzf Python-3.6.15.tgz
cd Python-3.6.15/
sudo ./configure --enable-optimizations
sudo make altinstallVerify the installation:
python3.6 -V
# Output: Python 3.6.15Install pip for Python 3.6:
python3.6 -m ensurepip --default-pip
which pip3.6
pip3.6 -VSet up a workspace and a virtual environment for CARLA:
cd $HOME/
mkdir -p workspace
cd workspace
python3.6 -m venv .venvActivate the virtual environment:
source .venv/bin/activateInstall the required Python packages for CARLA. Installing them in the order shown is important to avoid dependency conflicts:
pip install --upgrade pip setuptools wheel
pip install pyyaml jinja2 typeguard
pip install scipy==1.5.4
pip install numpy==1.14.5
pip install matplotlib==2.2.2
pip install pillow==3.1.2
pip install pygame==1.9.4
pip install future==0.16.0
pip install protobuf==3.6.0This guide and much of the underlying work in this repository are based on the CARLA simulator, developed by the CVC group at the Universitat Autònoma de Barcelona (UAB). The flexibility and open-source nature of CARLA have made it a cornerstone for research in autonomous driving and simulation.
For more details about CARLA and its development, visit the official CARLA GitHub repository.
This guide is a work in progress. If you encounter issues or have suggestions, contributions are welcome via pull requests. Let’s make CARLA accessible to everyone—on and off the road. 🚗