https://github.com/commonroad/miqp-contingency-planner
An MIQP-based contingency planner for autonomous driving under uncertainty. The planner maintains multiple candidate trajectories that share an initial segment and branch later to cover different possible evolutions of the driving environment.
https://github.com/commonroad/miqp-contingency-planner
Last synced: 5 months ago
JSON representation
An MIQP-based contingency planner for autonomous driving under uncertainty. The planner maintains multiple candidate trajectories that share an initial segment and branch later to cover different possible evolutions of the driving environment.
- Host: GitHub
- URL: https://github.com/commonroad/miqp-contingency-planner
- Owner: CommonRoad
- License: bsd-3-clause
- Created: 2026-01-23T14:39:02.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-27T10:53:47.000Z (5 months ago)
- Last Synced: 2026-01-27T22:42:39.686Z (5 months ago)
- Language: Jupyter Notebook
- Size: 280 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MIQP-based contingent planning
## Overview
This repository implements an MIQP-based contingency planner for autonomous driving under uncertainty. The planner maintains multiple candidate trajectories that share an initial segment and branch later to cover different possible evolutions of the driving environment. Unlike heuristic methods, the branching time is optimized as a decision variable within a receding-horizon framework.
## Installation Guide
The codebase targets Python 3.10 and has been tested on Ubuntu 20.04. We recommend using Anaconda to manage the environment so you can always return to a clean setup if something goes wrong.
Create a new Conda environment with Python 3.10:
```bash
conda create -n miqp_planner python=3.10 -y
```
In this guide, the environment is named `miqp_planner`. You may choose a different name, but use it consistently in the commands below. Then activate the environment:
```bash
conda activate miqp_planner
```
Ensure the environment remains activated before running any project-related commands.
Clone the repository using SSH and enter the project directory:
```bash
git clone git@gitlab.lrz.de:cps/commonroad/miqp-based-contingency-planner.git
cd miqp-based-contingency-planner
```
This project uses Poetry for dependency management. Install Poetry inside the activated Conda environment:
```bash
pip install poetry
poetry --version
```
Install all required dependencies according to the locked versions in `poetry.lock`, and install the project itself:
```bash
poetry install
```
This step may take several minutes depending on the system and network connection.
To verify that the project has been installed correctly, run:
```bash
python -c "import miqp_planner; print(miqp_planner.__file__)"
```
If no error occurs and a valid path is printed, the installation was successful.
## Optimization Solver License
This project relies on optimization solvers such as Gurobi. To use these solvers, a valid academic license is required.
Gurobi academic licenses:
https://www.gurobi.com/academia/academic-program-and-licenses/
After obtaining a license, install the Python interface:
```bash
conda install -c gurobi gurobi
```
## Folder Structure
```text
miqp-based-contingency-planner
|
├─ config
│ ├─ configuration.py # Dataclass-based configuration loader and updater
│ ├─ time_invariant_constraints.py # Time-invariant constraint definitions
│ ├─ intersection.yaml # Intersection scenario configuration
│ ├─ lane_change_mona.yaml # Lane-change (Mona) scenario configuration
│ └─ lane_change_multi.yaml # Multi-obstacle lane-change configuration
|
├─ experiments
│ ├─ visualization.py # Visualization helpers for planned trajectories
│ └─ simulator
│ ├─ opt_simulator.py # Optimization-based prediction simulator
│ ├─ sim_config.yaml # Simulator configuration
│ └─ utils.py # Simulator utility functions
|
├─ miqp_planner
│ ├─ miqp_planner_base.py # Base MIQP planner class and shared logic
│ ├─ miqp_long_planner.py # Longitudinal MIQP sub-planner
│ ├─ miqp_lat_planner.py # Lateral MIQP sub-planner
│ ├─ miqp_ks_planner.py # Kinematic single-track (KS) MIQP planner
│ ├─ miqp_enks_planner.py # Enhanced nonlinear KS (ENKS) MIQP planner
│ ├─ miqp_partial_planner.py # Partial MIQP planner variants
│ ├─ helper_functions.py # Reference path and helper utilities
│ ├─ safe_distance.py # Safe-distance constraint modeling
│ ├─ trajectory.py # Trajectory data structures and utilities
│ ├─ gurobi_optimizer.py # Gurobi-backed optimization routines
│ ├─ main.py # Main planner entry point
│ ├─ main_close_loop.py # Closed-loop experiment entry point
│ └─ main_multi_obs.py # Multi-obstacle experiment entry point
|
├─ scenarios # CommonRoad scenario XML files
|
├─ tests
│ └─ test_MIQP_planner.py # End-to-end MIQP planner tests
|
├─ pyproject.toml
├─ poetry.lock
├─ commonroad_style_guide.rst
├─ LICENSE.txt
└─ README.md
```