This is the codebase for the paper "Predicion-Based Reachability for Collision Avoidance in Autonomous Driving". In this codebase, we provide the code to cluster trajectory data into driving modes, to compute reachable tubes for each mode, and to simulate the two-car collision avoidance using safety controller.
This codebase is built on optimized_dp toolbox, PythonRobotics codebase, and uses Interaction dataset.
Please first read the setup procedure for optimized_dp toolbox.
Besides, please install the below packages using conda.
pickle
numpy
matplotlib
scikit-learn
pandas
pillow
shutil
json
This codebase contains three parts:
- Process the predicted trajectory data and cluster it into different driving mode, which includes:
prediction/
- Simulate the two-car collision avoidance
simulation/
- Compute reachable tubes for each driving mode
reachable_tube/
First, configure the data path in "def init(self): " in both prediction/process_prediction.py and prediction/predict_mode.py.
- Process the predicted trajectory data and obtain actions:
python prediction/process_prediction.py
- Cluster the action into driving mode
python prediction/clustering.py
- Predict driving mode giving a new trajectory
python prediction/predict_mode.py
- Compute reachable tube for 5d relative dynamics In reachable_tube/user_definer.py, comment the bicycle4D part and leave reldyn5D part, then
python reachable_tube/solver_reldyn5d.py
- Compute reachable tube for 4d bicycle dynamics (for curbs) In reachable_tube/user_definer.py, comment the reldyn5D part and leave bicycle4D part, then
python reachable_tube/solver_bicycle4d.py
Configure the data path in "def init(self):" in simulation/simulator_stanley_helper.py.
Configure the scenario and trial that you want to simulate in "def reset_trial(self, trial_name, scenario):" in simulation/simulator_stanley.py.
Run the simulation:
python simulation/simulator_stanley.py
If you use this work in your research please cite:
@article{li2020prediction,
title={Prediction-Based Reachability for Collision Avoidance in Autonomous Driving},
author={Li, Anjian and Sun, Liting and Zhan, Wei and Tomizuka, Masayoshi and Chen, Mo},
journal={arXiv preprint arXiv:2011.12406},
year={2020}
}