Skip to main content

mjswan

Real-time Interactive RL Simulation in Your Browser

deploy test docs pypi version npm version

mjswan is a powerful framework for creating interactive MuJoCo simulations with real-time policy control, running entirely in the browser. Built on top of mujoco wasm, onnxruntime, and three.js, it enables easy sharing of RL simulation demos as static sites, perfect for GitHub Pages hosting.

Check out the demo ― ttktjmt.github.io/mjswan


News

Features

  • Real-time: Run mujoco simulations and policy control in real time.
  • Interactive: Change the state of objects by applying forces.
  • Cross-platform: Works seamlessly on desktop and mobile devices.
  • VR & AR Support: Native WebXR viewer with tracked hands that interact with objects.
  • Client-only: All computation runs in the browser. No server for simulation is required.
  • Easy Sharing: Host as a static site for effortless demo distribution (e.g., GitHub Pages).
  • Portable: Embed the simulation in a web page or Google Colab notebook.
  • mjlab-native: Port any mjlab task to the web with the mjlab-to-mjswan skill.
  • Customizable: Visualize your mujoco models and onnx policies quickly.

Quick Start

mjswan can be installed with pip:

pip install mjswan  # or 'mjswan[dev]', 'mjswan[examples]'

or with npm:

npm install mjswan

The demos live in examples/, which the wheel does not ship, so run them with the mjswan CLI from a clone of this repository (after pip install -e '.[examples]'):

mjswan demo          # lists the bundled demos
mjswan demo simple   # runs the simple demo

The minimum python script for a sanity check:

import os, mujoco, mjswan

model_path = os.path.join(os.path.dirname(mujoco.__file__), "testdata", "model.xml")
mjspec = mujoco.MjSpec.from_file(model_path)

builder = mjswan.Builder()
builder.add_project(name="Sanity Check").add_scene(name="Test Model", spec=mjspec)
app = builder.build()
app.launch()

For detailed instructions, visit the documentation.

Acknowledgments

This project was greatly inspired by the Facet project demo from the research group at Tsinghua University.
It is also built upon the excellent work of zalo/mujoco_wasm, one of the earliest efforts to run MuJoCo simulations in a browser.

License

This project is licensed under the Apache-2.0 License. When using mjswan, please retain attribution notices in the app to help other users discover this project.

Metadata

Release files for mjswan 0.11.5

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

Source distribution (sdist)

Source distribution for mjswan 0.11.5
File Size Uploaded
mjswan-0.11.5.tar.gz 11.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for mjswan 0.11.5
File Interpreter ABI Platform
mjswan-0.11.5-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 MB

Release files / mjswan-0.11.5.tar.gz

Download URL mjswan-0.11.5.tar.gz
Size 11.5 MB
Tags Source
SHA-256 checksum
How to use checksums
c5970e6f70f297fe7efb1ceda1ee3afdbac95db96abb0152ff04eaf845a9bc74
BLAKE2b-256 checksum
How to use checksums
383db40b460671ccfdc056e800cecb92c44e2a7e600fe74d27aecc0b367a8946
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","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":true}

Release files / mjswan-0.11.5-py3-none-any.whl

Download URL mjswan-0.11.5-py3-none-any.whl
Size 11.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8515c2d7591dc8391f106a7b86526bbe63dfe1a889a4b91b1ab88da905cb143a
BLAKE2b-256 checksum
How to use checksums
3e05b5d223d22784af06152cdac4c4549187b8816c522d3daaf176b20d4ad21f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","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":true}

Release history Release notifications | RSS feed

0.11.9

2 release files

0.11.8

2 release files

0.11.7

2 release files

0.11.6

2 release files

This release

0.11.5 This release

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

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