Skip to main content

A unified framework for implementing and interfacing with MuJoCo and MuJoCo-XLA simulation environments.

Project description

moojoco-banner

MooJoCo provides a unified framework for implementing and interfacing with MuJoCo and MuJoCo-XLA simulation environments. The main goal of this framework is to unify the development and interfaces of environments implemented in native MuJoCo (MJC) and MuJoCo-XLA (MJX).

MJCFMorphology and MJCFArena

  • Both are parameterized/reconfigurable MJCF (MuJoCo-XML) generators that serve as input to an environment.
  • MJCFMorphology defines the robot morphology.
  • MJCFArena defines the arena in which the robot is places (i.e. all non-morphological structures).
    • MJCFArena are reconfigurable via a ArenaConfiguration

Unified MJC and MJX environment interface

  • Reconfigurable through an environment configuration
  • Functional programming
    • MJX requires the functional programming paradigm. To unify MJC and MJX, we thus apply this stronger coding constraint to the MJC side as well.
    • Simply said: functions are pure, and should not have side effects.
    • Environments expect states and return states.
  • Gymnasium-like interface
    • Environments provide an observation and action space (automatically)
    • Outside code interacts with the environment using the typical step, reset, render and close functions.
    • Main difference with the original gymnasium interface: here the environment returns and expects states, which encapsulates the original observations, rewards, info, etc. in a datastructure, together with the underlying physics state.
  • Differences between MJCEnv (i.e. a native MuJoCo environment) and MJXEnv (i.e. an MJX environment):
    • development: MJXEnv's should be implemented in JAX, MJCEnv's do not necessarily require JAX.
    • usage: MJXEnvState contains JAX arrays (and the additional mjx.Model and mjx.Data structures), the MJCEnvState uses numpy arrays.
  • Observations are implemented using Observables; these define retriever functions that extract the observation based on the state datastructure and provide an easy way to implement observations.
  • DualMuJocoEnvironment provides the unification of MJC and MJX, and allows conditional environment creation based on a backend string.
  • Both MJC and MJX support human-mode and rgb_array rendering modes.
    • Note: MJX rendering is slow due to the offloading of datastructures of the GPU

Examples

For practical applications and demonstrations of MooJoCo, please refer to the Bio-inspired Robotics Testbed, which employs this framework extensively.

Installation

pip install moojoco

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

moojoco-1.1.3.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

moojoco-1.1.3-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file moojoco-1.1.3.tar.gz.

File metadata

  • Download URL: moojoco-1.1.3.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for moojoco-1.1.3.tar.gz
Algorithm Hash digest
SHA256 d01f8071841e3caba3830a23550e874aeb6950b4016520fe928164bbadac3e73
MD5 8c47f69ad992189df6215fdb3fd50b49
BLAKE2b-256 881d04eaf78eb461e44fc5307b6fadaf2ccefc1ff838b9e0c8a97849d32a8cb0

See more details on using hashes here.

File details

Details for the file moojoco-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: moojoco-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for moojoco-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 243e39256a57dcff81a133c927ab33012aa88aeecf7e6a0cbe1b83f4b138d1e6
MD5 ebb4ddee6c85f1224776325c77de2643
BLAKE2b-256 c8e552105d280fc17179bb184625606d4efcdf3efbebeaad03c5102f4bf6ee3c

See more details on using hashes here.

Supported by

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