Software-Aurora-Lab / ADS-Scenario-Transformer

Transferring scenarios running on Apollo and SimControl environments to scenarios running on Autoware and TIER IV Scenario Simulator v2 environments.
MIT License
4 stars 0 forks source link

README #55

Closed hcn1519 closed 5 months ago

hcn1519 commented 5 months ago

Prerequisites

Installation

source ./scripts/setup_env.sh

Usage

1. Running Transformation

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
}

2. Running Scenarios in Docker

We also support a script for running scenarios in Docker. We play the scenario through this prebuilt image of Scenario Simulator and Autoware.

To play scenarios, first locate the scenario directories in ./experiments/exp_<unique_experiment_id>/scenarios/.

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