This repository consists of a handful of useful function to automatically extract simulation-runs from the Carla Simulator which then can be used by the CARLA Importer of the STARS framework. Examples of the resulting data can be found here.
Linux/Mac
To use the functions of this repository you need Python 3.7. Follow the instructions on the official website to install Python 3.7 on your system.
This repository requires a virtual environment. Follow these instructions to initialize a new virtual environment.
Install "virtualenv"
python3 -m pip install --user --upgrade pip
python3 -m pip install --user virtualenv
Now navigate to the root folder of this repository.
cd your/local/folder/stars-export-carla
Create a virtual environment.
python3 -m venv venv
Your virtual environment is now setup.
This repository depends on specific libraries to be correctly loaded into the virtual environment. To install these requirements follow these instructions:
Now navigate to the root folder of this repository.
cd your/local/folder/stars-export-carla
Install the requirements.txt
./venv/Scripts/python -m pip install -r ./requirements.txt
This will install all necessary requirements.
Windows
To use the functions of this repository you need Python 3.7. Follow the instructions on the official website to install Python 3.7 on your system.
This repository requires a virtual environment. Follow these instructions to initialize a new virtual environment.
Install "virtualenv"
py -m pip install --user --upgrade pip
py -m pip install --user virtualenv
Now navigate to the root folder of this repository.
cd your/local/folder/stars-export-carla
Create a virtual environment.
py -m venv venv
Your virtual environment is now setup.
This repository depends on specific libraries to be correctly loaded into the virtual environment. To install these requirements follow these instructions:
Now navigate to the root folder of this repository.
cd your/local/folder/stars-export-carla
Install the requirements.txt
./venv/Scripts/python.exe -m pip install -r ./requirements.txt
This will install all necessary requirements.
Firstly, you have to install Carla. Currently, this repository supports Carla 0.9.14
Now update the project with the path to your local Carla installation in:
Linux/Mac
scripts/shell_scripts/config.sh
Windows
scripts/batch_scripts/config.bat
The functions in this repository generate three kinds of data types:
- Map: In here, all "static" datapoints of the underlying road/lane structure for one specific map is
stored
Class details
- DataBlock - DataRoad - DataLane - DataLaneMidpoint - DataSpeedLimit - DataContactArea - DataLandmark - DataStaticTrafficLight - DataContactLaneInfo - Dynamic: In here, all "dynamic" datapoints, such as Vehicles, Pedestrians, and the traffic light states are
stored
Class details
- TickData - DataActorPosition - DataActor - DataTrafficLight - DataPedestrian - DataTrafficSign - DataVehicle - Weather: In here, the weather parameters of a scenario is stored
Class details
- DataWeatherParameters
There are pre-defined scripts that automate the process of generating scenario data files.
generate_data
: Generates recordings, and then monitors them and generates map datagenerate_map_data
: Only generate map data for all currently supported Carla mapsgenerate_recording
: Only generate one recording with a set seedgenerate_recordings
: Only generate the set number of seeds (0-100)generate_video
: Generate a video for a given seed, an actor id and the start and end timemonitor_all_recordings
: Iterate through all generated recordings and monitor all of themmonitor_recording
: Monitor one specific recording (by providing a seed)
This repository follows a specific order of generation steps, which are summarized here:
- Generation of recordings (
scripts/generate_recording
) - Generation of weather parameters
- Generation of dynamic data (
scripts/monitor_recording
)
Each step requires the results of the step above. Next, the generation steps are discussed in more detail.
Every generated file is located in the generated-data
folder, which is created during the generation.
Besides the two generation targets, the map data can be generated separately.
- Generation of map data (
scripts/generate_map_data
)
It is possible to call Carla's simulation with a set seed, so that the actor spawns and the route planning of the autonomous agents will always behave the same. Nevertheless, do the results differ in exact positions and timings of the actors in the simulation. Therefore, as a first step a Recording of the simulation is created. This stores the exact states of each actor (e.g. Vehicles, Pedestrian, Trafficlight states, etc.).
Each recording is generated with a specific seed, so that the generated files will be generated into:
/recordings/{map_name}/{map_name}_seed{seed}.zip
.
With these recordings it is possible to recreate specific scenario 1:1.
Each recoding generates random weather parameters that are set for the simulation.
For each recording a random set of weather parameters is generated.
Each Recording generates exactly one set of weather parameters which is generated into:
/recordings/{map_name}/weather_data_{map_name}_seed{seed}.zip
. With the seed in the generated file name,
each recording can be mapped to its weather parameters.
Each recording is then replayed and monitored. The monitor tracks the orientation and position of each actor in the whole simulation at all times. The dynamic data also includes the weather parameters.
For each recording file and the corresponding weather parameters file, a single dynamic data file is generated into:
/simulations_runs/{map_name}/dynamic_data_{map_name}_seed{seed}.zip
.
For each map, the static information is extracted and stored in
the map data type. For each map there is only one file generated, as the static data is persistent between
scenarios.
The map data will be generated into: /simulation_runs/{map_name}/static_data_{mapName}.zip
Currently supported:
- Town01
- Town02
- Town10