mujoco.sim

Python wrapper for MuJoCo physics simulation.


Keywords
physics, mujoco, wrapper, python-wrapper, physics-simulation
License
MIT
Install
pip install mujoco.sim==1.0.3

Documentation

MuJoCo for Python!

This is a simple python wrapper around the MuJoCo physics simulation. I wrote it when I couldn't fix the GLEW initialization error with mujoco-py. Please note: this library is a partial replacement (not a supplement) to mujoco-py. It is does not have all of the features of mujoco-py but it is much simpler and easier to understand. If there are additional capabilities you want added, please feel free to post an issue.

Installation

OS X

pip install mujoco

Linux

Building pypi wheels for linux packages that use C extensions (like this one) is very difficult (nay impossible?). Please install from source:

cd /path/to/cloned/directory
make
pip install -e .

Usage

Examples are located in the examples/ directory.

EGL

EGL is a graphics library for linux GPUs which speeds up offscreen rendering. First, you need to install libegl1-mesa and check that /usr/include/EGL/egl.h exists. Second, you must define the environment variable EGL=1. Otherwise, the code defaults to GLFW. Note that when using EGL, you cannot render to the screen (you can still render offscreen).

Headless Rendering

GLFW does not currently support headless rendering (usually this means rendering on a remote server without an attached display). Instead you must use EGL (if you are on an NVIDIA GPU) or OSMesa otherwise. To ensure that the proper libraries are built and imported, set headless: True in your config.yml.

Design

One of the main design decisions behind this implementation was to use the exact same libraries that Emo's original MuJoCo code uses in the provided Makefile. That way if my version doesn't work, you can bet that Emo's code doesn't work either. I think the reason why mujoco-py stopped working is that it tried to get fancy with the libraries and dynamically switch between EGL- and GLFW-friendly graphics libraries.

Documentation

Sadly, I haven't been able to load my docs to readthedocs.org yet, because of difficulties over importing the original MuJoCo headers on their servers (suggestions welcome). However, if you wish to build the docs yourself, the following commands should do it for you:

cd /path/to/cloned/directory
make
cd docs/
make html