Skip to content

BreenSammy/learning-corridor-selection

Repository files navigation

Deep Learning-Based High-Level Corridor Selection in Optimization-Based Motion Planning

This repository contains the source code for the Master's thesis: "Deep Learning-Based High-Level Corridor Selection in Optimization-Based Motion Planning".

Installation

To create the driving corridor dataset, the QP-Planner [1] is used. The code for the QP-Planner is provided in an extra folder.

It is recommended to use a virtual environment for this project. The code is tested with Python 3.9. For instance, create a conda virtual environment and activate it:

conda create -n learning-corridor-selection python=3.9
conda activate learning-corridor-selection

Install requirements in the conda environment:

pip install -r requirements.txt

Install the QP-Planner:

pip install ./commonroad-qp-planner

Finally open a terminal in the root directory of the project and install the project in editable mode:

pip install -e .

Install pytorch and pytorch-geometric:

pip install -v "torch==2.2" --index-url https://download.pytorch.org/whl/cu121
pip install torch_geometric

Dataset

The thesis uses highD and exiD datasets which are converted to CommonRoad scenarios with the open-source dataset converter. To create the dataset for training and evaluation of the deep learning model, following steps have to be followed:

  1. Get CommonRoad scenario files. For highD and exiD datasets, convert the dataset recordings to discrete scenarios.
  2. Save the scenarios you want to use within a dataset in data/DATASET_NAME/scenarios/ and create a hydra config in learning_corridor_selection/configs/dataset/ with name DATASET_NAME.yaml ( see highD.yaml or exiD.yaml configs for the correct format)
  3. Execute the run_planning.py script to run planning and save raw corridors, trajectories etc. in data/DATASET_NAME/raw/. Each scene is saved as an individual file. Depending on the amount of scenarios and the hardware, planning may take a couple of hours. The configurations for planning are in the configurations folder. Example command:
python learning_corridor_selection/run_planning.py dataset=DATASET_NAME
  1. Next, the raw dataset must be converted to a processed tensor format with the Dataset class. Processed samples are saved under data/DATASET_NAME/processed. This is done automatically the first time you execute the run_training.py script.

Before creating the dataset with the QP-Planner make sure that you have a mosek licence installed on the system or choose another optimizer in the planning config!

Training

The training loop is implemented in the training script. All configurations are handled with hydra configs inside the configs folder. For example, to start the training of the cost_regression model you can use this command:

python learning_corridor_selection/run_training.py --config-name=cost_regression

For monitoring during training, MLflow is used. Make sure to set up a tracking server and configure the URI to the server in the config.

Evaluation

For automated evaluation of the model results and the dataset, evaluation classes are provided. Please have a look at the model and dataset evaluation scripts.

Literature

[1] S. Manzinger, C. Pek, and M. Althoff, “Using Reachable Sets for Trajectory Planning of Automated Vehicles,” IEEE Transactions on Intelligent Vehicles, vol. 6, no. 2, pp. 232–248, 2020.

About

Deep-learning model for selection of high-level corridors in motion planning

Topics

Resources

License

Stars

Watchers

Forks

Languages