Code Monkey home page Code Monkey logo

mppi_torch's Introduction

logo

A fast and modular MPPI implementation with Halton spline sampling

Credits

Much of the backbone of the mppi implementation is based on pytorch_mppi, however it has been modified with addition sampling modes (e.g. Halton spline sampling) and support for ancillary controllers (priors) by Corrado Pezzato, Elia Trevisan and Chadi Salmi.

Structure

The project is structured as follows:

  • examples/: Contains the point robot example.
  • mppi_torch/: Contains the implementation of the MPPI algorithm and its utilities.
  • pyproject.toml and poetry.lock: Configuration files for project dependencies.

Installation

To install the project, follow these steps:

# Clone the repository
git clone <repository-url>

# Navigate to the project directory
cd <project-directory>

# Install dependencies
poetry install

Usage

To run the point robot example:

poetry shell
cd examples/point_robot
python run.py

Contributing

Contributions are welcome. Please submit a pull request.

Cite

This repository was originally developed for our paper Sampling-based Model Predictive Control Leveraging Parallelizable Physics Simulations. You can find that code here. If relevant, consider citing:

@misc{pezzato2023samplingbased,
      title={Sampling-based Model Predictive Control Leveraging Parallelizable Physics Simulations}, 
      author={Corrado Pezzato and Chadi Salmi and Max Spahn and Elia Trevisan and Javier Alonso-Mora and Carlos Hernandez Corbato},
      year={2023},
      eprint={2307.09105},
      archivePrefix={arXiv},
      primaryClass={cs.RO}
}

We also recently added the possibility of biasing the sampling distribution with ancillary controllers (or priors), as in Biased-MPPI: Informing Sampling-Based Model Predictive Control by Fusing Ancillary Controllers. Examples of how to use prior controllers with this repository can be found here. If you use this feature, consider citing:

@ARTICLE{trevisan2024biased,
  author={Trevisan, Elia and Alonso-Mora, Javier},
  journal={IEEE Robotics and Automation Letters}, 
  title={Biased-MPPI: Informing Sampling-Based Model Predictive Control by Fusing Ancillary Controllers}, 
  year={2024},
  volume={9},
  number={6},
  pages={5871-5878},
  keywords={Costs;Planning;Monte Carlo methods;Mathematical models;Optimal control;Vehicle dynamics;Trajectory;Motion and path planning;optimization and optimal control;collision avoidance;sampling-based MPC;MPPI},
  doi={10.1109/LRA.2024.3397083}}

mppi_torch's People

Contributors

eliatrevisan avatar

Stargazers

ZiSeoi Wong avatar Lee Thompson IV avatar Vlad Mosoiu avatar Shijie Cong avatar Anna Meszaros avatar Jeff Carpenter avatar Roman Chiva avatar Luzia Knoedler  avatar  avatar

Watchers

Carlos Hernandez Corbato avatar Roman Chiva avatar

mppi_torch's Issues

Did the halton-spline mode work

Dear author,

Hello! I have a question for the part of "halton-spline", the code in mppi.py is shown as below.

elif self.mppi_mode == 'halton-spline':
    # shift command 1 time step
    saved_action = self.mean_action[-1]
    self.mean_action = torch.roll(self.mean_action, -1, dims=0)
    self.mean_action[-1] = saved_action
    cost_total = self._compute_total_cost_batch_halton()
      
    action = torch.clone(self.mean_action)

In this part, the final 'action' is given by the mean of 'saved_action', and it only has a 'shift' operation and no other operations.

Is the method work, could you please explain this part. Thanks for your help.

Best wishes

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.