Faster physics in Python

We’re open-sourcing a high-performance Python library for robotic simulation using the MuJoCo engine, developed over our past year of robotics research.

OpenAI

We’re open-sourcing a high-performance Python library for robotic simulation using the MuJoCo engine, developed over our past year of robotics research.

Loopdiscogif2

We use the domain randomization⁠(opens in a new window) technique across many projects at OpenAI. The latest version of mujoco-py supports headless GPU rendering; this yields a speedup of ~40x compared to CPU-based rendering, letting us generate hundreds of frames per second of synthetic image data. In the above (slowed down) animation we use this to vary the textures of one of our robots, which helps it identify its body when we transfer it from the simulator to reality. Check out examples/disco_fetch.py⁠(opens in a new window) for an example of randomized texture generation.

The API exposed by mujoco-py is sufficient to enable Virtual Reality interaction without any extra C++ code. We ported MuJoCo’s C++ VR example⁠(opens in a new window) to Python using mujoco-py. If you have an HTC Vive VR setup, you can give try it using this example⁠(opens in a new window) (this support is considered experimental, but we’ve been using it internally for a while).

The simplest way to get started with mujoco-py is with the MjSim class⁠(opens in a new window). It is a wrapper around the simulation model and data, and lets you to easily step the simulation and render images from camera sensors. Here’s a simple example: