/python_simple_mppi

Python implementation of MPPI (Model Predictive Path-Integral) controller to understand the basic idea. Mandatory dependencies are numpy and matplotlib only.

Primary LanguageJupyter NotebookOtherNOASSERTION

License: MIT

Simple MPPI Implementation with Python

Model Predictive Path-Integral (MPPI) Control is a promising sampling-based optimal control algorithm.
This repository is for understanding the basic idea of the algorithm.

pathtracking demonstraion

swinging up pendulum demonstraion

swinging up pendulum demonstraion

Dependency

  • poetry : seting up python environment easily.
  • ffmpeg : mp4 movie writer

Setup

git clone https://github.com/MizuhoAOKI/python_simple_mppi.git
cd python_simple_mppi
poetry install

Usage

Path-Tracking

  • Run path-tracking simulation
    cd python_simple_mppi
    poetry run jupyter notebook notebooks/mppi_pathtracking.ipynb

Pendulum

pendulum

  • Run simulation to swing up a pendulum.

    cd python_simple_mppi
    poetry run python scripts/mppi_pendulum.py
  • Run notebook if you would like to check mathematical explanations on the algorithm.

    cd python_simple_mppi
    poetry run jupyter notebook notebooks/mppi_pendulum.ipynb

CartPole

cartpole

  • Run simulation of cartpole

    cd python_simple_mppi
    poetry run python scripts/mppi_cartpole.py
  • Run notebook if you would like to check mathematical explanations on the algorithm.

    cd python_simple_mppi
    poetry run jupyter notebook notebooks/mppi_cartpole.ipynb

References

  1. G. Williams et al. "Information-Theoretic Model Predictive Control: Theory and Applications to Autonomous Driving"