{"id":31847736,"url":"https://github.com/mizuhoaoki/python_simple_mppi","last_synced_at":"2025-10-12T09:54:26.402Z","repository":{"id":193797135,"uuid":"689511986","full_name":"MizuhoAOKI/python_simple_mppi","owner":"MizuhoAOKI","description":"Python implementation of MPPI (Model Predictive Path-Integral) controller to understand the basic idea. Mandatory dependencies are numpy and matplotlib only.","archived":false,"fork":false,"pushed_at":"2025-02-06T12:42:19.000Z","size":38351,"stargazers_count":367,"open_issues_count":7,"forks_count":42,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-06T13:43:45.094Z","etag":null,"topics":["animation","autonomous-driving","autonomous-vehicles","cartpole","control","model-predictive-control","mpc","mppi","nmpc","nonlinear-model-predictive-control","path-integral","path-tracking","pendulum","python","sampling-based-planning","stochastic-optimal-control"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MizuhoAOKI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-10T03:28:27.000Z","updated_at":"2025-02-06T12:42:22.000Z","dependencies_parsed_at":"2024-12-03T15:22:32.004Z","dependency_job_id":"43147d42-a8ab-46e5-8303-182d93fc8c5c","html_url":"https://github.com/MizuhoAOKI/python_simple_mppi","commit_stats":{"total_commits":43,"total_committers":1,"mean_commits":43.0,"dds":0.0,"last_synced_commit":"2b441c217753e458f7b413d6bbb9833705c35532"},"previous_names":["mizuhoaoki/python_simple_mppi"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MizuhoAOKI/python_simple_mppi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizuhoAOKI%2Fpython_simple_mppi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizuhoAOKI%2Fpython_simple_mppi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizuhoAOKI%2Fpython_simple_mppi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizuhoAOKI%2Fpython_simple_mppi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MizuhoAOKI","download_url":"https://codeload.github.com/MizuhoAOKI/python_simple_mppi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MizuhoAOKI%2Fpython_simple_mppi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010964,"owners_count":26084840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","autonomous-driving","autonomous-vehicles","cartpole","control","model-predictive-control","mpc","mppi","nmpc","nonlinear-model-predictive-control","path-integral","path-tracking","pendulum","python","sampling-based-planning","stochastic-optimal-control"],"created_at":"2025-10-12T09:54:07.749Z","updated_at":"2025-10-12T09:54:26.397Z","avatar_url":"https://github.com/MizuhoAOKI.png","language":"Jupyter Notebook","readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n[![Docker](https://img.shields.io/badge/-Docker-EEE.svg?logo=docker\u0026style=flat)](https://www.docker.com/)\n\n# Simple MPPI Implementation with Python\nModel Predictive Path-Integral (MPPI) Control [[G. Williams et al., 2018]](#references) is a promising sampling-based optimal control algorithm.  \nThis repository is for understanding the basic idea of the algorithm.\n\n\u003cimg src=\"./media/pathtracking_obav_demo.gif\" width=\"500px\" alt=\"pathtracking and obstacle avoidance demonstraion\"\u003e\n\u003cimg src=\"./media/pathtracking_demo.gif\" width=\"500px\" alt=\"pathtracking demonstraion\"\u003e\n\u003cimg src=\"./media/pendulum_swingup_demo.gif\" width=\"500px\" alt=\"swinging up pendulum demonstraion\"\u003e\n\u003cimg src=\"./media/cartpole_demo.gif\" width=\"500px\" alt=\"swinging up pendulum demonstraion\"\u003e\n\u003c!-- https://github.com/MizuhoAOKI/python_simple_mppi/assets/63337525/bda8cdbc-5cfd-4885-ac8d-3240867f027c --\u003e\n\n## Dependency\n\n- [python](https://www.python.org/)\n  - version 3.10 or higher is recommended.\n\n- [poetry](https://python-poetry.org/)\n  - setting up python environment easily and safely.\n  - only `numpy`, `matplotlib`, `notebook` are needed to run all scripts in this repository.\n\n- [ffmpeg](https://ffmpeg.org/)\n  - mp4 movie writer\n  - \u003cdetails\u003e\n    \u003csummary\u003einstallation details\u003c/summary\u003e\n\n    - For Ubuntu Users\n        - `sudo apt-get update`\n        - `sudo apt-get -y install ffmpeg`\n    - For Windows Users\n        - Install [scoop](https://scoop.sh/)\n        - `scoop install ffmpeg`\n    - For macOS Users\n        - Install [homebrew](https://brew.sh/)\n        - `brew install ffmpeg`\n    - Check the official website if necessary\n        - https://ffmpeg.org/\n\n    \u003c/details\u003e\n\n## Setup\n### [Option 1] Native environment\n```sh\ngit clone https://github.com/MizuhoAOKI/python_simple_mppi.git\ncd python_simple_mppi\npoetry install\n```\n\n### [Option 2] Docker environment\n\u003cdetails\u003e\n\u003csummary\u003eCLICK HERE TO EXPAND\u003c/summary\u003e\n\n1. Install [docker](https://docs.docker.com/engine/install/).\n\n1. Clone the project repository.\n    ```\n    cd \u003cpath to your workspace\u003e\n    git clone https://github.com/MizuhoAOKI/python_simple_mppi.git\n    ```\n\n1. Run for the first time setup to build the docker image. Building the image might take a few minutes.\n    ```\n    cd \u003cpath to your workspace\u003e/python_simple_mppi\n    docker build -t dev_mppi:v0.0 -f docker/Dockerfile .\n    ```\n\n1. Launch the docker container and get into the bash inside.\n    ```\n    cd \u003cpath to your workspace\u003e/python_simple_mppi\n    docker run -it -v .:/dev_ws/python_simple_mppi --name dev_mppi_container dev_mppi:v0.0 bash\n    ```\n    Once the container starts, any changes made in the local repository on the host will be reflected inside the container, and vice versa.\n\n\u003c/details\u003e\n\n\n## Usage\n\n### Path Tracking\n\u003cimg src=\"./media/pathtracking.png\" width=\"300px\" alt=\"pendulum\"\u003e\n\n#### Simple Path Tracking\n- Run simulation\n    ```sh\n    cd python_simple_mppi\n    poetry run python scripts/mppi_pathtracking.py\n    ```\n\n- Run jupyter notebook if you would like to check mathematical explanations on the algorithm.\n    ```sh\n    cd python_simple_mppi\n    poetry run jupyter notebook notebooks/mppi_pathtracking.ipynb\n    ```\n\n#### Path Tracking with Obstacle Avoidance\n- Run simulation\n    ```sh\n    cd python_simple_mppi\n    poetry run python scripts/mppi_pathtracking_obav.py\n    ```\n\n- Run jupyter notebook if you would like to check mathematical explanations on the algorithm.\n    ```sh\n    cd python_simple_mppi\n    poetry run jupyter notebook notebooks/mppi_pathtracking_obav.ipynb\n    ```\n\n### Pendulum\n\u003cimg src=\"./media/pendulum.png\" width=\"300px\" alt=\"pendulum\"\u003e\n\n- Run simulation to swing up a pendulum.\n    ```sh\n    cd python_simple_mppi\n    poetry run python scripts/mppi_pendulum.py\n    ```\n\n- Run jupyter notebook if you would like to check mathematical explanations on the algorithm.\n    ```sh\n    cd python_simple_mppi\n    poetry run jupyter notebook notebooks/mppi_pendulum.ipynb\n    ```\n\n### CartPole\n\u003cimg src=\"./media/cartpole.png\" width=\"300px\" alt=\"cartpole\"\u003e\n\n- Run simulation of cartpole\n    ```sh\n    cd python_simple_mppi\n    poetry run python scripts/mppi_cartpole.py\n    ```\n\n- Run jupyter notebook if you would like to check mathematical explanations on the algorithm.\n    ```sh\n    cd python_simple_mppi\n    poetry run jupyter notebook notebooks/mppi_cartpole.ipynb\n    ```\n\n## References\n1. G. Williams et al. \"Information-Theoretic Model Predictive Control: Theory and Applications to Autonomous Driving\" \n    - URL : https://ieeexplore.ieee.org/document/8558663\n    - PDF : https://arxiv.org/pdf/1707.02342.pdf\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizuhoaoki%2Fpython_simple_mppi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmizuhoaoki%2Fpython_simple_mppi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmizuhoaoki%2Fpython_simple_mppi/lists"}