Quick start


Requirements

The quickstart installation uses a pre-packaged version of CARLA. This comprises the content in a boundle that can run automatically with no build installation needed. The API can be accesseded fully but in exchange, advanced customization and developing options are unavailable.
However, some requirements are still a must.

  • Server side: A good GPU will be needed to run a highly realistic environment (4GB minimum). A dedicated GPU is highly advised for machine learning.
  • Client side: The API is accessed via command line. To do so, Python is necessary, and also a good internet connection and two TCP ports (2000 and 2001 by default).
  • System requirements: Any 64-bits OS should run the corresponding version of CARLA.
  • Other requirements: Only two specific Python modules: Pygame, to create graphics directly with Python and Numpy for great calculus.

If you have pip in your system, you can geth both modules simply by running the following commands:

 pip install --user pygame numpy

Downloading CARLA

The easiest way to get the latest release in Linux is using the apt repository.
To get either a specific release or get the Windows version of CARLA: download the repository.
Both methods will set CARLA ready to run.

a) apt-get CARLA 0.9.7

First, add the repository to the system:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB53A429E64554FC &&
sudo add-apt-repository "deb [trusted=yes] http://dist.carla.org/carla-0.9.7/ bionic main"

Then, simply install it. CARLA will be in the /opt/ folder, where other software such as ROS install themselves:

sudo apt-get update
sudo apt-get install carla

b) Downloading the repository

The repository contains the different versions of the simulator available. The development and stable sections, contain the packages for the different official releases. The later the version the more experimental it is. The nightly build is the current development version as today and so, the most unstable (developers are currently working with this build). If you want a more robust version, you may search for the latest tagged version.

Note

Latest Windows release is CARLA 0.9.5, but this is to be updated soon.

There may be many files per release. The package is named as CARLA_version.number (compressed file format .tar.gz for Linux and .zip for Windows). Other elements such as Town06_0.9.5.tar.gz are additional assets for Linux releases.

Download and extract the release in a folder of your choice. It contains a precompiled version of the simulator, the Python API module and some scripts to be used as examples.
If you downloaded any additional assets in Linux, move them to the Import folder that has appeared (there is no need to extract them). Open a terminal in the folder where you extracted CARLA and run the script ImportAssets to get the additional content automatically:

./ImportAssets.sh

Running CARLA

Open a terminal in the folder where CARLA was extracted. The following command will execute the package file and start the simulation:

Linux:
./CarlaUE4.sh

Windows:
CarlaUE4.exe

Important

In the apt-get installation, CarlaUE4.sh can be found in /opt/carla/bin/, instead of the main /carla/ folder where it normally is.

A window will open, containing a view over the city. This is the "spectator" view. To fly around the city use the mouse and WASD keys (while clicking). The simulator is now running as a server, waiting for a client app to connect and interact with the world.

Note

If the firewall or any other application are blocking the TCP ports needed, these can be manually changed by adding to the previous command the argument: -carla-port=N, being N the desired port. The second will be automatically set to N+1.

Command-line options

There are some configuration options available when launching CARLA:

  • -carla-rpc-port=N Listen for client connections at port N, streaming port is set to N+1 by default.
  • -carla-streaming-port=N Specify the port for sensor data streaming, use 0 to get a random unused port.
  • -quality-level={Low,Epic} Change graphics quality level.
  • Full list of UE4 command-line arguments (note that many of these won't work in the release version).
> ./CarlaUE4.sh -carla-rpc-port=3000

However, some may not be available (especially those provided by UE). For said reason, the script in PythonAPI/util/config.py provides for some more configuration options:

> ./config.py --no-rendering      # Disable rendering
> ./config.py --map Town05        # Change map
> ./config.py --weather ClearNoon # Change weather

To check all the available configurations, run the following command:

> ./config.py --help

Updating CARLA

The packaged version requires no updates. The content is bundled and thus, tied to a specific version of CARLA. Everytime there is a release, the repository will be updated. To run this latest or any other version, delete the previous one and repeat the installation steps with the desired.


Summary

That concludes the quickstart installation process. In case any unexpected error or issue occurs, the CARLA forum is open to everybody. There is an Installation issues category to post this kind of problems and doubts.

So far, CARLA should be operative in the desired system. Terminals will be used to contact the server via script and retrieve data. Thus will access all of the capabilities that CARLA provides. Next step should be visiting the First steps section to learn more about this. However, all the information about the Python API regarding classes and its methods can be accessed in the Python API reference.