Skip to content

Modular implementation of basic motion planning algorithm that based on Model Predictive Control (MPC) and Control Barrier Function (CBF).

License

Notifications You must be signed in to change notification settings

lihanlian/motion-planning-mpc

Repository files navigation

Overview

This repository is initiated by the final project of MECHENG 599 - Applied Optimal Control (2024 Fall) at University of Michigan - Ann Arbor. Model predictive control (MPC) and control barrier function (CBF) are used for robot motion planning problem with obstacle avoidance. The unicycle model is used as robot dynamics. Code is tested in Ubuntu operating system and it is implemented in Python 3.10. CasADi is used as optimization solver.

Disclaimer: This is NOT a research project. Some part might not be rigorous and suggestions are welcomed.

MPC-DC (N=25)

Image 1

MPC-CBF (N=25, γ = 0.8)

Image 1

Run Locally

Clone the project

  git clone https://github.com/lihanlian/motion-planning-mpc

Go to project directory

  python3 -m venv env && source env/bin/activate 
  pip install -r requirements.txt
  • config.py defines parameters including prediction horizion(N), total time steps, gamma (for CBF), etc.
  • run main.py to simulate feedback control loop and store the state and control trajectories.
  • run visualization.py to get the animation.
  • Two methods are used: mpc_dc and mpc_cbf. Choose one of them while running main.py and visualization.py. Adjust corresponding parameters in config.py if necessary.

References

License

MIT

About

Modular implementation of basic motion planning algorithm that based on Model Predictive Control (MPC) and Control Barrier Function (CBF).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages