Skip to content

Python implementation of mpc controller for path tracking

Notifications You must be signed in to change notification settings

bosky2001/mpc_python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpc_python

I keep here my Jupyter notebooks on R&D on Model Predictive Control applyied to path-following problems in driverless vehicles. Includes also a Pybullet simulation to showcase the results. This mainly uses CVXPY as a framework. This repo contains code from other projecs, check them out in the special thanks section.

Contents

Usage

From within the mpc_pybullet_demo directory:

  • To run the pybullet demo:
python3 mpc_demo_pybullet.py
  • To run the simulation-less demo (simpler demo that does not use pybullet, useful for debugging):
python3 mpc_demo_pybullet.py

In both cases the script will promt the user for enter before starting the demo.

The settings for tuning the MPC controller are in the mpc_config class.

Jupyter Notebooks

  1. State space model derivation -> analytical and numerical derivaion of the model

  2. MPC -> implementation and testing of various tweaks/improvements

  3. Obstacle Avoidance -> Using halfplane constrains to avaoid track collisions -> Sill work in progress!

Results

Racing car model is from: https://github.com/erwincoumans/pybullet_robots.

Results:

Requirements

The environment can be repoduced via conda:

conda env create -f env.yml
conda activate simulation

The dependencies for just the python scripts can also be installed using pip:

pip3 install --user --requirement requirements.txt

References & Special Thanks ⭐ :

About

Python implementation of mpc controller for path tracking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 98.1%
  • Python 1.9%