Efficiently Ensuring Traffic Rule Compliance of Motion Plans by Incorporating Scenario Knowledge – Evaluation Scripts
This repository contains the evaluation scripts for the paper "Efficiently Ensuring Traffic Rule Compliance of Motion Plans by Incorporating Scenario Knowledge". The implementation of the algorithms presented in the paper can be found here:
The repository contains the following files and directories:
.
├── configurations/    # Configuration files for the experiments
│
├── data/
│   ├── output/        # Raw results of the experiments presented in the paper
│   └── plots/         # Scenario plots shown in the paper
│
├── scenarios/         # CommonRoad scenarios for the motivating example and experiments
│
├── src/               # Source code for setting up the evaluation environment
│
└── *.py files         # Main scripts for the evaluation: see below for details
Due to license restrictions, we cannot provide the CommonRoad scenarios generated from the exiD and inD datasets. For non-commercial purposes, you can obtain the original datasets for free from the following links:
Then you can use the CommonRoad dataset converter to convert the datasets to CommonRoad scenarios.
- Pull the Docker image efficiently-ensuring-traffic-rule-compliancefrom the GitHub container registry (Docker may requiresudoroot privileges if your user is not in thedockergroup):
docker pull ghcr.io/commonroad/efficiently-ensuring-traffic-rule-compliance/efficiently-ensuring-traffic-rule-compliance:latest- After pulling the image, make sure that you are in the root directory of the repository (the directory containing this file) and start the container with:
docker run -it --rm -v $(pwd):/workspace ghcr.io/commonroad/efficiently-ensuring-traffic-rule-compliance/efficiently-ensuring-traffic-rule-compliance:latest /bin/bashThe command above mounts the current working directory into the Docker container. Thus, modifications to the code from inside the container will also be reflected on your local machine. Moreover, it allows you to access the results even after the container has stopped.
Note: If you are using Windows, you have to replace
$(pwd)by%cd%.
- Install the evaluation Python package in the Docker container:
pip install .If the package is installed successfully, you can run the experiments as described below.
Note: It can happen that you do not have permissions to access the files created inside the container from the host machine. In this case, you can change the owner of the files using
sudo chown -R $USER <directory>.
All results from the paper can be replicated with the evaluation scripts in this repository. We describe the purpose of each script in detail. To reduce the runtime of the scripts, you can lower the number of repetitions in the configuration files.
This script runs the experiments on exiD and inD scenarios.
It writes its measurements to the output directory in YAML format.
You can run the script as follows
python run_experiments.pyTo show advanced options for the script run
python run_experiments.py --helpThis script produces the statistics presented in the paper from the results of run_experiments.py.
By default, it expects the YAML files to be in the output directory.
You can run the script as follows
python analyze_results.pyTo show advanced options for the script run
python analyze_results.py --helpNote: It can happen that the monitoring algorithm produces inconsistent verdicts for some scenarios. The reason for this seems to be some non-determinism in the environment mode. Thus, if this happens, we suggest rerunning the scenarios in question with the
reuse_worldconfiguration option enabled. You can add the scenario names to the listscenarios_with_inconsistent_monitor_resultsinrun_experiments.pywhich will automatically rerun these scenarios with the aforementioned option.
This script plots the two example scenarios shown in the paper.
This script produces the figure used as motivating example in the paper.