Skip to main content

mojo-mujoco-wrapper

mojo-mujoco-wrapper is a Python library that wraps MuJoCo with a simple object-oriented API. You create and control simulation elements (bodies, geoms, joints, cameras, lights) as Python objects instead of working with MuJoCo's low-level arrays directly. The library handles model construction, recompilation, and physics stepping so you can focus on building scenes and controllers.

Installation

pip install mojo-mujoco-wrapper

Usage

Basic scene

from mojo import Mojo
from mojo.elements import Body, Geom, Joint
from mojo.elements.consts import JointType

mojo = Mojo("world.xml")

# Create a body with a box geom and a hinge joint
body = Body.create(mojo, position=[0, 0, 1])
geom = Geom.create(mojo, parent=body)
joint = Joint.create(mojo, parent=body, joint_type=JointType.HINGE)

# Step the simulation
for _ in range(100):
    mojo.step()

print(body.get_position())

Camera

from mojo.elements import Camera
import numpy as np

camera = Camera.create(mojo, position=[0, -2, 1])
camera.set_fovy(60.0)
camera.set_quaternion(np.array([1, 0, 0, 0]))

Kinematic bodies

body = Body.create(mojo, position=[0, 0, 0.5])
Geom.create(mojo, parent=body)
body.set_kinematic(True)  # body moves with set_position, ignores physics forces

body.set_position([1, 0, 0.5])
mojo.step()

Getting elements by name

body = Body.get(mojo, name="my_body")
camera = Camera.get(mojo, name="top_cam")

Development

Setup

git clone https://github.com/stepjam/mojo
cd mojo
pip install -e ".[dev]"

Running tests

pytest tests/

Contributing

  1. Fork the repo and create a branch off main.
  2. Add tests for any new elements or behavior.
  3. Open a pull request against main.

Metadata

Release files for mojo-mujoco-wrapper 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mojo-mujoco-wrapper 0.1.1
File Size Uploaded Provenance Actions
mojo_mujoco_wrapper-0.1.1.tar.gz 12.4 kB Without provenance Details for mojo_mujoco_wrapper-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mojo-mujoco-wrapper 0.1.1
File Interpreter ABI Platform Actions
mojo_mujoco_wrapper-0.1.1-py3-none-any.whl Python 3 none any Details for mojo_mujoco_wrapper-0.1.1-py3-none-any.whl

Total release size: 29.1 kB

Release files / mojo_mujoco_wrapper-0.1.1.tar.gz

Download URL mojo_mujoco_wrapper-0.1.1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ef03de6842b42b62ea656adc8b505d01fdbb2baae698e12be4e90ca09bac0a2e
BLAKE2b-256 checksum
How to use checksums
fbc0f40a941d287daaa66b69e9f39412b0391c9be1105da9d6f7fb05cc23f093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mojo_mujoco_wrapper-0.1.1-py3-none-any.whl

Download URL mojo_mujoco_wrapper-0.1.1-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb4f3abca0dd2259854afb2c5a637b42898b3086ef4276d7db02baed3d1130b3
BLAKE2b-256 checksum
How to use checksums
53498bfc2ecb4d9a5d91832178d886e8a309fe5fc16ac7c40df2062d1b48b940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mojo-mujoco-wrapper 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page