GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MizuhoAOKI/python_simple_mppi: Python implementation of MPPI (Model Predictive Path-Integral) controller to understand the basic idea. Mandatory dependencies are numpy and matplotlib only.

BranchesTags
Open more actions menu

Latest commit

 

History

72 Commits
72 Commits

Folders and files

NameName
Last commit message
Last commit date
data
data
 
 
docker
docker
 
 
media
media
 
 
notebooks
notebooks
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
.python-version
.python-version
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

License: MIT uv Docker

Simple MPPI Implementation with Python

Model Predictive Path-Integral (MPPI) Control [G. Williams et al., 2018] is a promising sampling-based optimal control algorithm.
This repository is for understanding the basic idea of the algorithm.

pathtracking and obstacle avoidance demonstraion

pathtracking demonstraion

swinging up pendulum demonstraion

swinging up pendulum demonstraion

Dependency

  • uv

    • A simple and fast Python package manager. Refer to the official documentation for one-command installation.
    • Only numpy, matplotlib, notebook are needed to run all scripts in this repository.
  • ffmpeg

    • mp4 movie writer

    • installation details
      • For Ubuntu Users
        • sudo apt-get update
        • sudo apt-get -y install ffmpeg
      • For Windows Users
        • Install scoop
        • scoop install ffmpeg
      • For macOS Users
        • Install homebrew
        • brew install ffmpeg
      • Check the official website if necessary
        • https://ffmpeg.org/

Setup

[Option 1] Native environment

git clone https://github.com/MizuhoAOKI/python_simple_mppi.git
cd python_simple_mppi
uv sync

[Option 2] Docker environment

CLICK HERE TO EXPAND
  1. Install docker.

  2. Clone the project repository.

    cd <path to your workspace>
    git clone https://github.com/MizuhoAOKI/python_simple_mppi.git
    
  3. Run setup to build the docker image, launch the docker container and get into the bash inside. Building the image might take a few minutes.

    cd <path to your workspace>/python_simple_mppi
    docker compose run --rm dev
    

    This command will automatically build the Docker image if needed. Once the container starts, any changes made in the local repository on the host will be reflected inside the container, and vice versa.

Usage

Path Tracking

pendulum

Simple Path Tracking

  • Run simulation

    cd python_simple_mppi
    uv run scripts/mppi_pathtracking.py
  • Run jupyter notebook if you would like to check mathematical explanations on the algorithm.

    cd python_simple_mppi
    uv run jupyter notebook --notebook-dir=. notebooks/mppi_pathtracking.ipynb

Path Tracking with Obstacle Avoidance

  • Run simulation

    cd python_simple_mppi
    uv run scripts/mppi_pathtracking_obav.py
  • Run jupyter notebook if you would like to check mathematical explanations on the algorithm.

    cd python_simple_mppi
    uv run jupyter notebook --notebook-dir=. notebooks/mppi_pathtracking_obav.ipynb

Pendulum

pendulum

  • Run simulation to swing up a pendulum.

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

    cd python_simple_mppi
    uv run jupyter notebook --notebook-dir=. notebooks/mppi_pendulum.ipynb

CartPole

cartpole

  • Run simulation of cartpole

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

    cd python_simple_mppi
    uv run jupyter notebook --notebook-dir=. notebooks/mppi_cartpole.ipynb

References

  1. G. Williams et al. "Information-Theoretic Model Predictive Control: Theory and Applications to Autonomous Driving"
    • URL : https://ieeexplore.ieee.org/document/8558663
    • PDF : https://arxiv.org/pdf/1707.02342.pdf

About

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

Topics

animationautonomous-drivingautonomous-vehiclescartpolecontrolmodel-predictive-controlmpcmppinmpcnonlinear-model-predictive-controlpath-integralpath-trackingpendulumpythonsampling-based-planningstochastic-optimal-control

Resources

Readme
License
Activity

Stars

822 stars

Watchers

13 watching

Forks

83 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.