Autoware Scenario Test runner - hcn1519/ADS GitHub Wiki
Running Predefined scenarios
Example 1
ros2 launch scenario_test_runner scenario_test_runner.launch.py \
architecture_type:=awf/universe \
record:=false \
scenario:='$(find-pkg-share scenario_test_runner)/scenario/sample.yaml' \
sensor_model:=sample_sensor_kit \
vehicle_model:=sample_vehicle
[INFO] [launch]: Default logging verbosity is set to INFO
architecture_type := awf/universe
autoware_launch_file := planning_simulator.launch.xml
autoware_launch_package := autoware_launch
global_frame_rate := 30.0
global_real_time_factor := 1.0
global_timeout := 180
initialize_duration := 30
launch_autoware := True
launch_rviz := False
output_directory := /tmp
port := 5555
record := false
rviz_config :=
scenario := $(find-pkg-share scenario_test_runner)/scenario/sample.yaml
sensor_model := sample_sensor_kit
sigterm_timeout := 8
vehicle_model := sample_vehicle
workflow := /dev/null
Example 2
ros2 launch scenario_test_runner scenario_test_runner.launch.py \
architecture_type:=awf/universe \
record:=false \
scenario:='$(find-pkg-share scenario_test_runner)/scenario/RoutingAction.FollowTrajectoryAction-autoware.yaml' \
sensor_model:=sample_sensor_kit \
vehicle_model:=sample_vehicle
[INFO] [launch]: Default logging verbosity is set to INFO
architecture_type := awf/universe
autoware_launch_file := planning_simulator.launch.xml
autoware_launch_package := autoware_launch
global_frame_rate := 30.0
global_real_time_factor := 1.0
global_timeout := 180
initialize_duration := 30
launch_autoware := True
launch_rviz := False
output_directory := /tmp
port := 5555
record := false
rviz_config :=
scenario := $(find-pkg-share scenario_test_runner)/scenario/RoutingAction.FollowTrajectoryAction-autoware.yaml
sensor_model := sample_sensor_kit
sigterm_timeout := 8
vehicle_model := sample_vehicle
workflow := /dev/null
ros2 launch scenario_test_runner scenario_test_runner.launch.py \
architecture_type:=awf/universe \
record:=false \
scenario:='$(find-pkg-share scenario_test_runner)/scenario/collision.yaml' \
sensor_model:=sample_sensor_kit \
vehicle_model:=sample_vehicle
- There are other samples, but not all of them is running on the Autoware environment.
Record and Replay Scenarios
Recording
- Set argument
record
to true when you run scenarios.
ros2 launch scenario_test_runner scenario_test_runner.launch.py \
architecture_type:=awf/universe \
record:=true \
scenario:='$(find-pkg-share scenario_test_runner)/scenario/sample.yaml' \
sensor_model:=sample_sensor_kit \
vehicle_model:=sample_vehicle
ros2 launch scenario_test_runner scenario_test_runner.launch.py \
architecture_type:=awf/universe \
record:=true \
scenario:='$(find-pkg-share scenario_test_runner)/scenario/RoutingAction.FollowTrajectoryAction-autoware.yaml' \
sensor_model:=sample_sensor_kit \
vehicle_model:=sample_vehicle
Replaying scenarios
To play rosbag2 you need to open up 2 different shells. One is for running Autoware with simulator and the other is for playing rosbag.
docker exec -it container_id /bin/bash
- First Shell - Run Autoware with the map. Map should be same as the one you used for running scenario.
ros2 launch autoware_launch logging_simulator.launch.xml \
map_path:=./autoware_map/sample-map-rosbag \
vehicle_model:=sample_vehicle \
sensor_model:=sample_sensor_kit
- Second Shell - If you succeed to record, the output rosbag data would be located in
output_directory
.(default location is/tmp
)
ros2 bag play /tmp/scenario_test_runner/sample/sample_0/sample_0_0.db3 -r 0.2 -s sqlite3
TroubleShooting
ModuleNotFoundError
You can encounter error like below, once you run scenario runner.
[scenario_test_runner.py-1] import xmlschema [scenario_test_runner.py-1] ModuleNotFoundError: No module named 'xmlschema'
- In this case, Run below commands and execute scenario again.
sudo apt update
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
[openscenario_interpreter_node-3] [ERROR] [1709771398.945031661] [simulation.concealer_user]: Shutting down Autoware: (2/3) Autoware launch process does not respond. Kill it.
[openscenario_interpreter_node-3] [INFO] [1709771398.948498331] [simulation.concealer_user]: Shutting down Autoware: (3/3) Waiting for Autoware to be exited.
[openscenario_interpreter_node-3] [INFO] [1709771399.085419649] [simulation.openscenario_interpreter]: AutowareError: Simulator waited for the Autoware state to transition to WaitingForRoute, but time is up. The current Autoware state is INITIALIZING.