Docs/start_quickstart.md
This guide shows how to download and install the packaged version of CARLA. The package includes the CARLA server and two options for the client library. There are additional assets that can be downloaded and imported into the package. Advanced customization and development options that require use of the Unreal Engine editor are not available but these can be accessed by using the build version of CARLA for either Windows or Linux.
The following requirements should be fulfilled before installing CARLA:
# For Python 3 pip3 -V
If you need to upgrade:
# For Python 3 pip3 install --upgrade pip
!!! important CARLA requires the Microsoft Visual C++ Redistributable to run on Windows. Without it, the simulator will fail to launch without any error message. Download and install it from the Microsoft website. Choose the x64 version under "Visual Studio 2015, 2017, 2019, and 2022".
pip3 install --user pygame numpy
pip3 install --user pygame numpy
Download the desired CARLA package from GitHub:
This repository contains different versions of CARLA. You will find options to download the current release with all the most recent fixes and features, previous releases and a nightly build with all the developmental fixes and features (the nightly build is the most unstable version of CARLA).
The package is a compressed file named CARLA_version.number. Download and extract the release file. It contains a precompiled version of the simulator, the Python API module and some scripts to be used as examples.
!!! note The documentation you are currently viewing is for the Unreal Engine 5 versions of CARLA. If you are intending to use the Unreal Engine 4 version of CARLA, you should refer the the correct documentation.
Install the CARLA client library from the wheel provided with the package:
cd CARLA_ROOT/PythonAPI/dist/
pip3 install carla-*.*.*-cp3**-linux_x86_64.whl
The characters denoted by wildcards depend upon the version of the simulator you are using and your Python version.
It is recommended to install the CARLA client library in a virtual environment to avoid conflicts when working with multiple versions.
You may also wish to install the wheel directly from the package, to ensure version consistency. Locate the CARLA Python wheel in PythonAPI/dist and install it with PIP.
Linux:
cd path/to/carla/root
./CarlaUnreal.sh
Windows:
cd path/to/carla/root
CarlaUnreal.exe
!!! note If CARLA fails to launch on Windows without any error message or log output, ensure that you have installed the Microsoft Visual C++ Redistributable (x64 version). This is a common issue on fresh Windows installations.
A window containing a view over Town 10 will pop up. This is the spectator view. To fly around the city use the mouse and WASD keys, holding down the right mouse button to control the direction.
This window is driven by the simulator server which is now running and waiting for a client to connect and interact with the world. You can try some of the example scripts to create traffic in the city and drive a vehicle around the map. Open up two separate terminals and run the following commands:
# Terminal A
cd PythonAPI\examples
pip3 install -r requirements.txt
python3 generate_traffic.py
# Terminal B
cd PythonAPI\examples
python3 manual_control.py
For Linux users, CARLA is available in a Docker image, which you may use if you need to run it on the cloud or a cluster or if your machine does not meet the software or operating system prerequisites.
Firstly, install Docker by following the installation instructions. You may want to follow the post installation instructions to avoid the need for sudo commands.
Next, install the NVIDIA container toolkit using the installation instructions and then follow the configuration instructions.
Then you may run CARLA in the Docker container using the following commands:
Running the Docker image without display:
docker run \
--runtime=nvidia \
--net=host \
--env=NVIDIA_VISIBLE_DEVICES=all \
--env=NVIDIA_DRIVER_CAPABILITIES=all \
carlasim/carla:0.10.0 bash CarlaUnreal.sh -RenderOffScreen -nosound
Running the Docker image with a display:
To run the Docker image with a display, you will need the x11 display protocol:
docker run \
--runtime=nvidia \
--net=host \
--user=$(id -u):$(id -g) \
--env=DISPLAY=$DISPLAY \
--env=NVIDIA_VISIBLE_DEVICES=all \
--env=NVIDIA_DRIVER_CAPABILITIES=all \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
carlasim/carla:0.10.0 bash CarlaUnreal.sh -nosound
By now you should have a packaged version of CARLA up and running. If you came across any difficulties during the installation process, feel free to post in the CARLA forum or in the Discord channel.
The next step is to learn more about the core concepts in CARLA. Start with the First steps tutorial to start learning and then refer to the Foundations, Actors, Maps and Sensors sections to form a deeper understanding of CARLA's functionality. You should also familiarize yourself with the Python API classes and methods in the Python API reference.