Surveying Attack Models for CAVs
Guide to Installing CARLA and Collecting Data
Our project focuses on surveying attack models for Connveced Autonomous Vehicles (CAVs). The primary tool we will be using throughout the project is CARLA, a vehicle simulation platform. This document serves a guide to how to get CARLA running on your system as well as show off a script we adapted from orginal CARLA install. This closely follows the quick installation from the CARLA leaderboard challenge.
Requirements
CARLA runs best for Ubuntu 18.04 and for Windows. The following requirements are for an Ubuntu system:
- Python 3
- Anaconda
- pip installer
- 6 GB GPU
- 20 GB of disk space
Installation
-
Download the CARLA 0.9.10.1 release found here and unzip the package into a folder named CARLA.
-
Download leaderboard repo:
git clone -b stable --single-branch https://github.com/carla-simulator/leaderboard.git
-
Switch to your CARLA root directory and run the following:
pip3 install -r requirements.txt
-
Clone the scenario runner repo
git clone -b leaderboard --single-branch https://github.com/carla-simulator/scenario_runner.git
-
cd into the scenario runner directory and run the following:
pip3 install -r requirements.txt
-
Now the environment variables need to be defined. Open a fresh terminal and open the bash profile:
gedit ~/.bashrc
-
Add the following to the bash profile:
export CARLA_ROOT=PATH_TO_CARLA_ROOT export SCENARIO_RUNNER_ROOT=PATH_TO_SCENARIO_RUNNER export LEADERBOARD_ROOT=PATH_TO_LEADERBOARD export PYTHONPATH="${CARLA_ROOT}/PythonAPI/carla/":"${SCENARIO_RUNNER_ROOT}":"${LEADERBOARD_ROOT}":"${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.10-py3.7-linux-x86_64.egg":${PYTHONPATH}
-
source
so the changes can take place:source ~/.bashrc
Running CARLA
To run CARLA simply open the terminal, change into your CARLA directory and run the following:
./CarlaUE4.sh
This should open an environment that looks like this:
Collecting Data
For our project, we are primary concerned with collecting LiDAR, Radar, Camera and GPS data. Thus far, we have a basic test python script that will log the latitude and longitude of an vehicle placed in the environment.
The test script can be found under tutorials/alana_test.py
. This script should be placed under your CARLA root directory in PythonAPI.
The output will be .csv, a sample of which can be found under tutorials/outputgnss.csv
. It should look like:
time | latitude | longitude | altitude |
---|---|---|---|
8.076389706286136 | 0.001497075674478765 | 0.0013884266232332388 | 2.5777945518493652 |
12.463837534713093 | 0.0015216552946100137 | 0.0013888545621243858 | 2.003244638442993 |
16.73477230645949 | 0.0015536632594717048 | 0.0013894208066981615 | 1.2948381900787354 |
21.952862125413958 | 0.001598166573884896 | 0.0013902203478743502 | 0.5753694176673889 |
27.885887853393797 | 0.001605972963332647 | 0.001390361257925631 | 0.47810444235801697 |