!!! important This tutorial refers to the latest versions of CARLA (at least 0.9.2)
Welcome to the ScenarioRunner for CARLA! This tutorial provides the basic steps for getting started using the ScenarioRunner for CARLA.
Download the latest release from our GitHub page and extract all the contents of the package in a folder of your choice.
The release package contains the following
- The ScenarioRunner for CARLA
- A few example scenarios written in Python.
The current version is designed to be used with Ubuntu 16.04, Python 2.7 (or Python 3.5) and python-py-trees (v0.8.3). To install python-py-trees select one of the following commands, depending on your Python version.
pip2 install --user py_trees==0.8.3 # For Python 2.x
pip3 install --user py_trees==0.8.3 # For Python 3.x
Note: py-trees newer than v0.8 is NOT supported.
Other dependencies:
In addition, you have to install Python networkx. You can install it via:
sudo apt-get install python-networkx
Also psutil is needed for running the challenge evaluation.
pip install psutil
Please make sure that you install networkx for the Python version you want to use.
First of all, you need to get latest master branch from CARLA. Then you have to include CARLA Python API to the Python path:
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla-<VERSION>.egg:${CARLA_ROOT}/PythonAPI
NOTE:
Now, you can start the CARLA server with Town01 from ${CARLA_ROOT}
./CarlaUE4.sh /Game/Carla/Maps/Town01 -benchmark -fps=20 -windowed
Please note that using the benchmark mode with a defined frame rate is very important to achieve a deterministic behavior.
Start the example scenario (follow a leading vehicle) in an extra terminal:
python scenario_runner.py --scenario FollowLeadingVehicle
If you require help or want to explore other command line parameters, start the scenario runner as follows:
python scenario_runner.py --help
To control the ego vehicle within the scenario, open another terminal and run:
python manual_control.py
Similar to the previous example, it is also possible to execute a sequence of scenarios, that belong to the same class, e.g. the "FollowLeadingVehicle" class.
The only difference is, that you start the scenario_runner as follows:
python scenario_runner.py --scenario group:FollowLeadingVehicle
A list of supported scenarios is provided in List of Supported Scenarios. Please note that different scenarios may take place in different CARLA towns. This has to be respected when launching the CARLA server.