ADS Scenario Transformer transfers scenarios running on Apollo and SimControl environments to scenarios running on Autoware and TIER IV Scenario Simulator v2 environments. The transformation process targets two critical elements of a driving scenario: (1) the movement patterns of obstacles within the simulation, and (2) the status changes of traffic signals.
- Python 3.10
- Linux OS
Clone this project and install dependency. We are using poetry
to manage project.
git clone https://github.com/Software-Aurora-Lab/ADS-Scenario-Transformer.git
pip install poetry
poetry install
Check if it works by running unit test.
poetry run pytest
We have a script to run the transformer for transforming multiple scenarios at once.
poetry run python3 scripts/run_transformer.py <apollo_scenario_dir_path> <config_file_path>
This command transforms all scenarios in <apollo_scenario_dir_path>
using the configuration defined in <config_file_path>
. For example:
poetry run python3 scripts/run_transformer.py \
../ADS_DataSet/DoppelTest_borregas_ave_30 \
./scripts/config/borregasave_doppeltest.json
Running the transformer requires many arguments, which are listed here. You can define them in a configuration file in JSON format like below:
{
"apollo-map-path": "./samples/map/BorregasAve/base_map.pickle",
"vector-map-path": "./samples/map/BorregasAve/lanelet2_map.osm",
"road-network-lanelet-map-path": "/home/sora/Desktop/changnam/autoware_map/BorregasAve/lanelet2_map.osm",
"source-name": "BorregasAve-DoppelTest",
"obstacle-waypoint-frequency": 5,
"output-scenario-path": "./BorregasAve",
"disable-traffic-signal": false,
"use-last-position-destination": true,
"add-violation-detecting-conditions": true
}
You can see more examples in here
We also support a script for running scenarios in Docker. We play the scenario through this prebuilt image of Scenario Simulator and Autoware.
- Install Prerequisites listed in Autoware document.
- Create directory at
./experiments/exp_<unique_experiment_id>/scenarios
- Locate directiory containing scenarios at
scenarios
. You can put multiple directories in there. Script will create summary for each directory. - Run experiemnt. The experiment running script can be run with the following command:
poetry run python3 scripts/scenario_player/experiment_runner.py --experiment_id <unique_experiment_id> \
--docker_image_id <docker_image_id> \
--map_path <map_directory_path> \
--enable_third_person_view \
--display_gui
For example:
poetry run python3 scripts/scenario_player/experiment_runner.py --experiment_id 5 \
--docker_image_id 6f0050135292 \
--map_path ./samples/map \
--enable_third_person_view \
--display_gui