mujoco_mpc

Real-time behaviour synthesis with MuJoCo, using Predictive Control

https://github.com/google-deepmind/mujoco_mpc

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    2 of 22 committers (9.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary

Keywords

model-predictive-control motor-control mpc mpc-control mujoco predictive-control

Keywords from Contributors

reinforcement-learning deep-neural-networks distributed
Last synced: 6 months ago · JSON representation ·

Repository

Real-time behaviour synthesis with MuJoCo, using Predictive Control

Basic Info
Statistics
  • Stars: 1,404
  • Watchers: 27
  • Forks: 226
  • Open Issues: 46
  • Releases: 2
Topics
model-predictive-control motor-control mpc mpc-control mujoco predictive-control
Created about 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License Citation

README.md

MuJoCo MPC

MuJoCo MPC (MJPC) is an interactive application and software framework for real-time predictive control with MuJoCo, developed by Google DeepMind.

MJPC allows the user to easily author and solve complex robotics tasks, and currently supports multiple shooting-based planners. Derivative-based methods include iLQG and Gradient Descent, while derivative-free methods include a simple yet very competitive planner called Predictive Sampling.

Overview

To read the paper describing this software package, please see our preprint.

For a quick video overview of MJPC, click below.

Video

For a longer talk at the MIT Robotics Seminar in December 2022 describing our results, click below.

2022Talk

A more recent, December 2023 talk at the IEEE Technical Committee on Model-Based Optimization is available here:

2023Talk

Example tasks

Quadruped task:

Quadruped

Bimanual manipulation:

Bimanual

Rubik's cube 10-move unscramble:

Unscramble

Humanoid motion-capture tracking:

Tracking

Graphical User Interface

For a detailed dive of the graphical user interface, see the MJPC GUI documentation.

Installation

MJPC is tested with Ubuntu 20.04 and macOS-12. In principle, other versions and Windows operating system should work with MJPC, but these are not tested.

Prerequisites

Operating system specific dependencies:

macOS

Install Xcode.

Install ninja and zlib: sh brew install ninja zlib

Ubuntu 20.04

sh sudo apt-get update && sudo apt-get install cmake libgl1-mesa-dev libxinerama-dev libxcursor-dev libxrandr-dev libxi-dev ninja-build zlib1g-dev clang-12

Clone MuJoCo MPC

sh git clone https://github.com/google-deepmind/mujoco_mpc

Build and Run MJPC GUI application

  1. Change directory: sh cd mujoco_mpc

  2. Create and change to build directory: sh mkdir build cd build

  3. Configure:

macOS-12

sh cmake .. -DCMAKE_BUILD_TYPE:STRING=Release -G Ninja -DMJPC_BUILD_GRPC_SERVICE:BOOL=ON

Ubuntu 20.04

sh cmake .. -DCMAKE_BUILD_TYPE:STRING=Release -G Ninja -DCMAKE_C_COMPILER:STRING=clang-12 -DCMAKE_CXX_COMPILER:STRING=clang++-12 -DMJPC_BUILD_GRPC_SERVICE:BOOL=ON Note: gRPC is a large dependency and can take 10-20 minutes to initially download.

  1. Build sh cmake --build . --config=Release

  2. Run GUI application sh cd bin ./mjpc

Build and Run MJPC GUI application using VSCode

We recommend using VSCode and 2 of its extensions (CMake Tools and C/C++) to simplify the build process.

  1. Open the cloned directory mujoco_mpc.
  2. Configure the project with CMake (a pop-up should appear in VSCode)
  3. Set compiler to clang-12.
  4. Build and run the mjpc target in "release" mode (VSCode defaults to "debug"). This will open and run the graphical user interface.

Build Issues

If you encounter build issues, please see the Github Actions configuration. This provides the exact setup we use for building MJPC for testing with Ubuntu 20.04 and macOS-12.

Python API

We provide a simple Python API for MJPC. This API is still experimental and expects some more experience from its users. For example, the correct usage requires that the model (defined in Python) and the MJPC task (i.e., the residual and transition functions defined in C++) are compatible with each other. Currently, the Python API does not provide any particular error handling for verifying this compatibility and may be difficult to debug without more in-depth knowledge about MuJoCo and MJPC.

Installation

Prerequisites

  1. Build MJPC (see instructions above).

  2. Python 3.10

  3. (Optionally) Create a conda environment with Python 3.10: sh conda create -n mjpc python=3.10 conda activate mjpc

  4. Install MuJoCo sh pip install mujoco

Install API

Next, change to the python directory: sh cd python

Install the Python module: sh python setup.py install

Test that installation was successful: sh python "mujoco_mpc/agent_test.py"

Example scripts are found in python/mujoco_mpc/demos. For example from python/: sh python mujoco_mpc/demos/agent/cartpole_gui.py will run the MJPC GUI application using MuJoCo's passive viewer via Python.

Python API Installation Issues

If your installation fails or is terminated prematurely, we recommend deleting the MJPC build directory and starting from scratch as the build will likely be corrupted. Additionally, delete the files generated during the installation process from the python/ directory.

Predictive Control

See the Predictive Control documentation for more information.

Contributing

See the Contributing documentation for more information.

Known Issues

MJPC is not production-quality software, it is a research prototype. There are likely to be missing features and outright bugs. If you find any, please report them in the issue tracker. Below we list some known issues, including items that we are actively working on.

  • We have not tested MJPC on Windows, but there should be no issues in principle.
  • Task specification, in particular the setting of norms and their parameters in XML, is a bit clunky. We are still iterating on the design.
  • The Gradient Descent search step is proportional to the scale of the cost function and requires per-task tuning in order to work well. This is not a bug but a property of vanilla gradient descent. It might be possible to ameliorate this with some sort of gradient normalisation, but we have not investigated this thoroughly.

Citation

If you use MJPC in your work, please cite our accompanying preprint:

bibtex @article{howell2022, title={{Predictive Sampling: Real-time Behaviour Synthesis with MuJoCo}}, author={Howell, Taylor and Gileadi, Nimrod and Tunyasuvunakool, Saran and Zakka, Kevin and Erez, Tom and Tassa, Yuval}, archivePrefix={arXiv}, eprint={2212.00541}, primaryClass={cs.RO}, url={https://arxiv.org/abs/2212.00541}, doi={10.48550/arXiv.2212.00541}, year={2022}, month={dec} }

Acknowledgments

The main effort required to make this repository publicly available was undertaken by Taylor Howell and the Google DeepMind Robotics Simulation team.

License and Disclaimer

All other content is Copyright 2022 DeepMind Technologies Limited and licensed under the Apache License, Version 2.0. A copy of this license is provided in the top-level LICENSE file in this repository. You can also obtain it from https://www.apache.org/licenses/LICENSE-2.0.

This is not an officially supported Google product.

Owner

  • Name: Google DeepMind
  • Login: google-deepmind
  • Kind: organization

Citation (CITATION.bib)

@article{howell2022,
  title={{Predictive Sampling: Real-time Behaviour Synthesis with MuJoCo}},
  author={Howell, Taylor and Gileadi, Nimrod and Tunyasuvunakool, Saran and Zakka, Kevin and Erez, Tom and Tassa, Yuval},
  archivePrefix={arXiv},
  eprint={2212.00541},
  primaryClass={cs.RO},
  url={https://arxiv.org/abs/2212.00541},
  doi={10.48550/arXiv.2212.00541},
  year={2022},
  month={dec}
}

GitHub Events

Total
  • Issues event: 38
  • Watch event: 344
  • Issue comment event: 62
  • Push event: 18
  • Pull request review event: 9
  • Pull request event: 18
  • Fork event: 66
Last Year
  • Issues event: 38
  • Watch event: 344
  • Issue comment event: 62
  • Push event: 18
  • Pull request review event: 9
  • Pull request event: 18
  • Fork event: 66

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 1,065
  • Total Committers: 22
  • Avg Commits per committer: 48.409
  • Development Distribution Score (DDS): 0.484
Past Year
  • Commits: 20
  • Committers: 5
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.65
Top Committers
Name Email Commits
taylor howell t****l@g****m 550
Tom Erez e****m@g****m 145
Nimrod Gileadi n****d@g****m 124
Yuval Tassa t****a@g****m 56
Kristian Hartikainen k****n@g****m 45
taylor t****l@g****m 37
Saran Tunyasuvunakool s****a@g****m 28
alberthli a****i@c****u 24
Copybara-Service c****r@g****m 22
Kevin Zakka k****a@g****m 7
Alessio Quaglino q****o@g****m 6
nkhosh n****r@m****a 5
Daniel Tan d****7 4
Kyle Bayes k****s@g****m 3
Robert Keszeg k****t@g****m 2
Ben Moran b****n@g****m 1
Ein04 r****u@g****m 1
Joss Moore j****m@g****m 1
Rafael Kourdis r****s@g****m 1
Silvio Traversaro s****o@t****t 1
Vince Kurtz v****z@g****m 1
vittorione94 v****4@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 56
  • Total pull requests: 47
  • Average time to close issues: 25 days
  • Average time to close pull requests: 25 days
  • Total issue authors: 41
  • Total pull request authors: 14
  • Average comments per issue: 1.88
  • Average comments per pull request: 0.64
  • Merged pull requests: 23
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 30
  • Pull requests: 20
  • Average time to close issues: 19 days
  • Average time to close pull requests: about 1 month
  • Issue authors: 23
  • Pull request authors: 10
  • Average comments per issue: 1.37
  • Average comments per pull request: 0.3
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ppap36 (5)
  • MyelinsheathXD (4)
  • thowell (3)
  • DMackRus (3)
  • Tadinu (3)
  • keszegrobert (3)
  • richardrl (3)
  • alberthli (3)
  • MiaoDragon (2)
  • nimrod-gileadi (2)
  • cinogul (2)
  • d-dimos (2)
  • huihuaNvidia2023 (2)
  • oscarkfpang (2)
  • erez-tom (1)
Pull Request Authors
  • thowell (60)
  • erez-tom (21)
  • alberthli (8)
  • JafarAbdi (4)
  • MoritzMeser (4)
  • nkhosh (4)
  • yuvaltassa (3)
  • nimrod-gileadi (3)
  • AshAnand34 (2)
  • aajin126 (2)
  • rkourdis (2)
  • pac48 (2)
  • keszegrobert (2)
  • nsk126 (1)
  • Aayushongit (1)
Top Labels
Issue Labels
enhancement (3) documentation (2)
Pull Request Labels

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v3 composite
python/setup.py pypi
  • grpcio *
  • grpcio-tools *