Skip to main content

Browser-based MuJoCo simulation with real-time policy control

Project description

Muwanx Python SDK

PyPI version Python versions License

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

muwanx-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

muwanx-0.0.2-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

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

Hashes for muwanx-0.0.2.tar.gz
Algorithm Hash digest
SHA256 75347d498b8998b0f5f05a994b5bb4779e480511f23e4e550e71bd74b1a2ead0
MD5 bf87403aea81d43f6e2fa759432512c6
BLAKE2b-256 69383e25644345ae827d17e519d947aa47686f2da07e12a6984aa97b0cbd279b

See more details on using hashes here.

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

Hashes for muwanx-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af1eff2244b8212b36c58cfa8e4743b25611b6180ec68816127e5493566e9364
MD5 6513d424ce033f7e8a11c62030c547aa
BLAKE2b-256 3b94ad509e46e1381f1571b6cf9b82783226abfa9e2287bee505f6b821a8a5d9

See more details on using hashes here.

Supported by

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