Browser-based MuJoCo simulation with real-time policy control
Project description
Muwanx Python SDK
Python SDK for creating and deploying interactive MuJoCo simulations with trained policies in the browser.
Muwanx is a browser-based MuJoCo playground that enables real-time policy control without requiring a server. The Python SDK provides a convenient interface to configure projects, scenes, and policies for deployment as static sites (e.g., GitHub Pages).
Features
- 🚀 Browser-based: Run MuJoCo simulations with real-time policy control in the browser
- 🎯 Easy Configuration: Simple Python API for setting up projects and policies
- 📦 ONNX Support: Deploy PyTorch/JAX models using ONNX format
- 🌐 Static Hosting: Generate static sites for GitHub Pages or any web server
- 🔧 Flexible: Customize observations, actions, and scene configurations
Installation
pip install muwanx
Quick Start
import muwanx
# Create a project
project = muwanx.Project(name="My Robot Project")
# Add a scene with MuJoCo model
scene = project.add_scene(
id="robot_walk",
name="Robot Walking",
model_path="./robot.xml"
)
# Add ONNX policy
policy = scene.add_policy(
id="locomotion",
onnx_path="./policy.onnx",
config={
"observations": [
{"type": "BaseLinearVelocity"},
{"type": "JointPositions", "joint_names": "isaac"}
],
"actions": {
"type": "isaac",
"joint_names": ["joint1", "joint2"]
}
}
)
# Build and deploy
project.build(output_dir="./dist")
Configuration
Scene Configuration
scene = project.add_scene(
id="my_scene",
name="My Scene",
model_path="./model.xml",
initial_state={
"qpos": [0.0, 0.0, 1.0], # Initial joint positions
"qvel": [0.0, 0.0, 0.0] # Initial joint velocities
}
)
Policy Configuration
policy = scene.add_policy(
id="my_policy",
onnx_path="./policy.onnx",
config={
"observations": [
{"type": "BaseLinearVelocity"},
{"type": "BaseAngularVelocity"},
{"type": "ProjectedGravity"},
{"type": "JointPositions", "joint_names": "isaac"},
{"type": "JointVelocities", "joint_names": "isaac"}
],
"actions": {
"type": "isaac",
"joint_names": ["FR_hip", "FR_thigh", "FR_calf", ...]
}
}
)
License
Apache-2.0 License. See LICENSE for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file muwanx-0.0.2.tar.gz.
File metadata
- Download URL: muwanx-0.0.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75347d498b8998b0f5f05a994b5bb4779e480511f23e4e550e71bd74b1a2ead0
|
|
| MD5 |
bf87403aea81d43f6e2fa759432512c6
|
|
| BLAKE2b-256 |
69383e25644345ae827d17e519d947aa47686f2da07e12a6984aa97b0cbd279b
|
File details
Details for the file muwanx-0.0.2-py3-none-any.whl.
File metadata
- Download URL: muwanx-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af1eff2244b8212b36c58cfa8e4743b25611b6180ec68816127e5493566e9364
|
|
| MD5 |
6513d424ce033f7e8a11c62030c547aa
|
|
| BLAKE2b-256 |
3b94ad509e46e1381f1571b6cf9b82783226abfa9e2287bee505f6b821a8a5d9
|