Skip to main content

Judo: a hackable sampling-based MPC toolbox

Project description

Judo 🥋

task dropdown

Python   Test Status   Docs Status   Coverage Status

judo is a python package inspired by mujoco_mpc that makes sampling-based MPC easy. Features include:

  • 👩‍💻 A simple interface for defining custom tasks and controllers.
  • 🤖 Automatic parsing of configs into a browser-based GUI, allowing real-time parameter tuning.
  • 📬 Asynchronous interprocess communication using dora for easy integration with your hardware.
  • 🗂️ Configuration management with hydra for maximum flexibility.

⚠️ Disclaimer ⚠️

This code is released as a research prototype and is not production-quality software. It may contain missing features and potential bugs. The RAI Institute does not guarantee maintenance or support for this software. While we encourage contributions and may accept pull requests for new features or bugfixes, we cannot guarantee timely responses to issues.

The current release is also in alpha. We reserve the right to make breaking changes to the API and configuration system in future releases. We will try to minimize these changes, but please be aware that they may occur.

Quickstart

This section walks you through the installation and usage of judo. For more details, see the docs.

1. Installation

Using pip

We recommend installing judo using pip as follows:

pip install judo-rai  # if you want dev dependencies, use judo-rai[dev]

Developers

Conda

For developers, run the following commands from this folder after cloning:

conda create -n judo python=3.13
conda activate judo
pip install -e .[dev]
pre-commit install
pybind11-stubgen mujoco -o typings/  # stops type checkers from complaining

Pixi

You can also use pixi instead of conda, which has the added benefit of having an associated lock file that ensures complete reproducibility.

To install pixi, run the following:

curl -fsSL https://pixi.sh/install.sh | sh

To create our environment (and activate it each time later), run the following in the repo root:

# every time you want to activate
pixi shell -e dev

# first time only
pre-commit install
pybind11-stubgen mujoco -o typings/

2. Run the judo app!

To start the simulator, you can simply run:

judo

This will start the stack and print a link in the terminal that will open the app in your browser, e.g.,

http://localhost:8080

We package judo with a few starter tasks and optimizers. If you want to start the simulator with one of these, you can run:

judo task=<task_name> optimizer=<optimizer_name>

where task_name is one of the following:

cylinder_push
cartpole
fr3_pick
leap_cube
leap_cube_down
caltech_leap_cube

and optimizer_name is one of the following:

cem
mppi
ps

This is not necessary, though, because you can use the dropdown menus to switch between tasks and optimizers after launching the app.

task dropdown optimizer dropdown

You can also run the app programmatically from some other script or program.

from judo.cli import app

if __name__ == "__main__":
    # do whatever you want here, like registering tasks/optimizers/overrides, etc.
    app()  # this runs the app from your own script

To see more information about the available tasks, please refer to the task README.

3. Running judo as a Dependency

You can easily install judo as a dependency in your own project. A few comments:

  • You can still use the judo CLI command from anywhere, so long as you are working in an environment where judo is installed.
  • If you do this, you should use the hydra configuration system to do things like registering custom tasks and optimizers, modifying the dora nodes in the sim stack, etc. See the Configuration with hydra and Config Registration sections for more details.
  • You can also run the app programmatically, as shown above.

4. Benchmarking

To benchmark all registered tasks and optimizers, simply run

benchmark

This will loop through all task/optimizer pairs and check the planning time over 100 samples. The end result will be printed to the console, showing useful statistics on your system.

Note that the benchmarking program runs the default task and optimizer parameters (subject to default task-specific overrides). If you want to benchmark with different settings, please read the information below, which explains how to change defaults.

Docs

For developers, to build docs locally, run the following in your environment from the repo root. Note that asset paths will be broken locally that work correctly on Github Pages.

pip install -r docs/requirements.txt
sphinx-build docs/source docs/build -b dirhtml
python -m http.server --directory docs/build 8000

🤝 Contributing

We welcome contributions! See our CONTRIBUTING.md guide to get started.

Citation

If you use judo in your research, please use the following citation:

@inproceedings{li2025_judo,
  title     = {Judo: A User-Friendly Open-Source Package for Sampling-Based Model Predictive Control},
  author    = {Albert Li and Brandon Hung and Aaron D. Ames and Jiuguang Wang and Simon Le Cleac'h and Preston Culbertson},
  booktitle = {Proceedings of the Workshop on Fast Motion Planning and Control in the Era of Parallelism at Robotics: Science and Systems (RSS)},
  year      = {2025},
  url       = {https://github.com/bdaiinstitute/judo},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

judo_rai-0.0.2.tar.gz (9.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

judo_rai-0.0.2-py3-none-any.whl (90.9 kB view details)

Uploaded Python 3

File details

Details for the file judo_rai-0.0.2.tar.gz.

File metadata

  • Download URL: judo_rai-0.0.2.tar.gz
  • Upload date:
  • Size: 9.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for judo_rai-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d5ae7137ec2dc2c890f6e8165783b514bf091ac5642ffe0a96f944cb89eb98ef
MD5 42eb88e2fbe378f724206ef77e81b284
BLAKE2b-256 5018cdf2a1f40a2930416da98f30f9d150ff4593bfd5064cbc4536e9a19f094e

See more details on using hashes here.

File details

Details for the file judo_rai-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: judo_rai-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 90.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for judo_rai-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d5c65dd62107492e5ca18cb30933f949d63416c0664ece74b475cf4aa6825a94
MD5 fe19c13be50f18c3a235c1dede14c887
BLAKE2b-256 e36c77630bf49a60128d396fe5b59a48e21149c60eb0d27aa824c5bbdeb03def

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page