Code Monkey home page Code Monkey logo

python-mppi's Introduction

License: MIT

Note

This repository is my attempt at implementing Model Predictive Path Integral Control. I have taken the setup from the original repository (https://github.com/MizuhoAOKI/python_simple_mppi) and implemented my own version in it. TODO: implement CBF instead of current collision check

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

swinging up pendulum demonstraion

Dependency

  • python

    • version 3.10 or higher is recommended.
  • poetry

    • seting up python environment easily and safely.
    • 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
      • Check the official website if necessary

Setup

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

Usage

Path Tracking

pendulum

Simple Path Tracking

  • Run simulation

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

    cd python_simple_mppi
    poetry run jupyter notebook notebooks/mppi_pathtracking.ipynb

Path Tracking with Obstacle Avoidance

  • Run simulation

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

    cd python_simple_mppi
    poetry run jupyter notebook notebooks/mppi_pathtracking_obav.ipynb

Pendulum

pendulum

  • Run simulation to swing up a pendulum.

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

    cd python_simple_mppi
    poetry run jupyter notebook notebooks/mppi_pendulum.ipynb
    
    

References

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

python-mppi's People

Contributors

bosky2001 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.