7.1 KiB
Quick start
- Installation summary
- Requirements
- Downloading CARLA
- a) deb CARLA installation
- b) GitHub repository installation
- Running CARLA
- Command-line options
- Updating CARLA
- Follow-up
Installation summary
Show command line summary for the quick start installation
# Install required modules Pygame and Numpy.
pip install --user pygame numpy
# Option A) deb package installation (only Linux)
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"
sudo apt-get update
sudo apt-get install carla
cd /opt/carla/bin
./CarlaUE4.sh
# Option B) GitHub repository installation
# Go to: https://github.com/carla-simulator/carla/blob/master/Docs/download.md
# Download the desired package and additional assets.
# Extract the package.
# Extract the additional assets in `/Import`
# Run CARLA (Linux)
./CarlaUE.sh
# Run CARLA (Windows)
> CarlaUE4.exe
# Run a script to test CARLA
cd PythonAPI/examples
python3 spawn_npc.py
Requirements
The quick start installation uses a pre-packaged version of CARLA. The content is comprised in a boundle that can run automatically with no build installation needed. The API can be accesseded fully but advanced customization and development options are unavailable.
The requirements are simpler than those for the build installation.
- Server side. A 4GB minimum GPU will be needed to run a highly realistic environment. A dedicated GPU is highly advised for machine learning.
- Client side. Python is necessary to access the API via command line. Also, a good internet connection and two TCP ports (2000 and 2001 by default).
- System requirements. Any 64-bits OS should run CARLA.
- Other requirements. Two Python modules: Pygame to create graphics directly with Python, and Numpy for great calculus.
To install both modules using pip, run the following commands.
pip install --user pygame numpy
Downloading CARLA
The deb installation is the easiest way to get the latest release in Linux.
Download the GitHub repository to get either a specific release or the Windows version of CARLA.
a) deb CARLA installation
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"
Install CARLA and check for the installation in the /opt/
folder.
sudo apt-get update
sudo apt-get install carla
cd /opt/carla
b) GitHub repository installation
The repository contains the different versions of the simulator available. Development and stable sections list 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.
There may be many files per release. The package is a compressed file named as CARLA_version.number. Other elements such as Town06_0.9.5.tar.gz are additional assets.
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.
Move any additional assets to the Import folder in the release and extract them. The script ImportAssets in the main CARLA folder should extract these automatically.
> cd ~/carla
> ./ImportAssets.sh
Running CARLA
Open a terminal in the main CARLA folder. Run the following command to execute the package file and start the simulation:
# Linux:
> ./CarlaUE4.sh
# Windows:
> CarlaUE4.exe
!!! Important
In the deb installation, CarlaUE4.sh
will be in /opt/carla/bin/
, instead of the main /carla/
folder where it normally is.
A window containing a view over the city will pop up. This is the spectator view. To fly around the city use the mouse and WASD
keys (while clicking). The server simulator is now running and waiting for a client to connect and interact with the world.
Now it is time to start running scripts. The following example will spawn some life into the city:
# Go to the folder containing example scripts
> cd PythonAPI/examples
> python3 spawn_npc.py
Command-line options
There are some configuration options available when launching CARLA.
-carla-rpc-port=N
Listen for client connections at portN
. Streaming port is set toN+1
by default.-carla-streaming-port=N
Specify the port for sensor data streaming. Use 0 to get a random unused port. The second port will be automatically set toN+1
.-quality-level={Low,Epic}
Change graphics quality level. Find out more in rendering options.- Full list of UE4 command-line arguments. There is a lot of options provided by UE. However, not all of these will be available in CARLA.
> ./CarlaUE4.sh -carla-rpc-port=3000
The script PythonAPI/util/config.py
provides for more configuration options.
> ./config.py --no-rendering # Disable rendering
> ./config.py --map Town05 # Change map
> ./config.py --weather ClearNoon # Change weather
> ./config.py --help # Check all the available configuration options.
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 and install the one desired.
Follow-up
Thus concludes the quick start 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, interact with the simulation and retrieve data. To do so, it is essential to understand the core concepts in CARLA. Read the First steps section to learn on those. Additionally, all the information about the Python API regarding classes and its methods can be accessed in the Python API reference.