Skip to content

Model Predictive Path Integral Control (MPPI) with PyTorch

License

Notifications You must be signed in to change notification settings

proxima-technology/mppi_playground

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPPI Playground

This repository contains an implementation of Model Predictive Path Integral Control (MPPI) with PyTorch to accelerate computations on the GPU.

Tested Native Environment

  • Ubuntu Focal 20.04 (LTS)
  • NVIDIA Driver 510 or later due to PyTorch 2.x

Dependencies

  • cuda 11.8
  • Python 3.10
  • PyTorch 2.0
Docker Setup

Install Docker

Installation guide

# Install from get.docker.com
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo groupadd docker
sudo usermod -aG docker $USER

Setup GPU for Docker

Installation guide

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
  && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list 

sudo apt-get update

sudo apt-get install -y nvidia-container-toolkit nvidia-container-runtime

sudo nvidia-ctk runtime configure --runtime=docker

sudo systemctl restart docker

Installation

with Docker (Recommend)

# build container
make build

# Open remote container via Vscode (Recommend)
# 1. Open the folder using vscode
# 2. Ctrl+P and select 'devcontainer rebuild and reopen in container'
# Then, you can skip the following commands

# Or Run container via terminal
make bash

with venv

python3 -m venv .venv
source .venv/bin/activate
pip3 install -e .[dev]

Examples

Navigation 2D

python3 app/navigation2d.py

navigation2d

Pendulum

python3 app/pendulum.py

pendulum

Cartpole

python3 app/cartpole.py

cartpole

Mountain car

python3 app/mountaincar.py

mountaincar

Reference

About

Model Predictive Path Integral Control (MPPI) with PyTorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.4%
  • Dockerfile 4.4%
  • Makefile 1.2%