Random test runner#
Random test runner allows running randomly generated scenarios to test Autoware autonomy implementation. For more information regarding Random test runner features and limitations please see Usage.
How to build#
- Clone the Autoware Core/Universe repository and move to the directory:
git clone git@github.com:autowarefoundation/autoware.git cd autoware
- Import Autoware and Simulator dependencies:
mkdir src vcs import src < autoware.repos vcs import src < simulator.repos
- Install dependencies for Autoware Core/Universe
./setup-dev-env.sh
- Install dependent ROS packages.
source /opt/ros/humble/setup.bash rosdep install -iry --from-paths src --rosdistro $ROS_DISTRO
- Build the workspace.
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
How to run#
First complete build described in How to build section.
Being in the main project directory run:
source install/setup.bash
ros2 launch random_test_runner random_test.launch.py
Which will run random tests with default parameters. Similarly to the image below you should see several npcs spawned in random locations around the ego vehicle, which will move on random path following the goal.
Detailed description of the possible parameters can be found under Parameters.
#
After test is completed see /tmp
directory. Among others, there will be two files:
1. result.junit.xml
- test result file with information about encountered errors.
2. result.yaml
- yaml file that can be used to replay tests.
For the more specified information about output files please see Results.
#
It might happen that the random test runner will behave unexpectedly and the test will not launch correctly. For further details regarding known issues please see Troubleshooting.
How to replay#
Prerequisites:
1. Build as instructed in How to build
2. Acquire result.yaml
file:
1. Either by running test as stated in How to run part of instruction.
2. Receiving it from someone who already ran it.
3. Place result.yaml
in <some_directory>
IMPORTANT: Do not change filename.
4. Execute:
ros2 launch random_test_runner random_test.launch.py input_dir:=<some_directory>
Random test runner will load result.yaml
file and rerun test.
Running with unity#
Autoware build update#
- Clone RobotecAI's Autoware and move to the directory
git clone git@github.com:RobotecAI/autoware-1.git cd autoware-1
- Checkout the
awsim-ss2-stable
branchgit checkout awsim-ss2-stable
- Import Autoware and Simulator dependencies:
mkdir src vcs import src < autoware.repos vcs import src < simulator.repos
- Install dependencies for Autoware Core/Universe
./setup-dev-env.sh
- Install dependent ROS packages.
source /opt/ros/humble/setup.bash rosdep install -iry --from-paths src --rosdistro $ROS_DISTRO
- Download and extract shinjuku_map.zip archive
unzip <Download directory>/shinjuku_map.zip -d src/simulator
- Build the solution
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
Preparing Unity project#
Follow Setup Unity Project tutorial
Running the demo#
- Open AutowareSimulationScenarioSimulator.unity scene placed under
Assets/AWSIM/Scenes/Main
directory - Run the simulation by clicking
Play
button placed at the top section of Editor. - Launch
random_test_runner
.
ros2 launch random_test_runner random_test.launch.py map_name:=shinjuku_map simulator_type:=awsim \
npc_count:=5 initialize_duration:=260 sensor_model:=awsim_sensor_kit vehicle_model:=sample_vehicle \
autoware_launch_file:=e2e_simulator.launch.xml autoware_architecture:="awf/universe/20230906"
Known issues#
-
Due to misalignment of lanelet and some parts of the AWSIM environment, Ego entity is being spawned below the terrain. The misalignment will be fixed in a future version of the package.
-
when the
npc_count
is too big the NPCs start to slide sideways and the localization does not work properly. Reasons are yet unknown and more investigation should be conducted. It was determined that the working number of NPCs is 5