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 Support: Native VR viewer support with WebXR.
  • 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: Create a web demo of any mjlab tasks with minimal effort.
  • 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

You can run the bundled demo with the mjswan CLI (after installing mjswan[examples]):

mjswan demo          # runs the default demo
mjswan demo --list   # see all available demos

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.

Third-Party Assets

mjswan incorporates mujoco models from the external sources in its demo. See the respective submodule for full details, including individual model licenses and copyrights. All models are used under their respective licenses. Please review and comply with those terms for any use or redistribution.

Robot Descriptions LicenseMuJoCo Playground LicenseMyoSuite License

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mjswan-0.9.3.tar.gz (23.2 MB view details)

Uploaded Source

Built Distribution

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

mjswan-0.9.3-py3-none-any.whl (23.5 MB view details)

Uploaded Python 3

File details

Details for the file mjswan-0.9.3.tar.gz.

File metadata

  • Download URL: mjswan-0.9.3.tar.gz
  • Upload date:
  • Size: 23.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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}

File hashes

Hashes for mjswan-0.9.3.tar.gz
Algorithm Hash digest
SHA256 57fdc5fd55f30cd51a9a34a8ec280fa529f0258ae857ef10aab4e867236323b7
MD5 0d87b404a2dba093c18921cba8a1b1b7
BLAKE2b-256 2f95c8d0a4fbefaacaad4c65c9c7d0bdf0f2d9eae816b8d7e2d3c31671390d89

See more details on using hashes here.

File details

Details for the file mjswan-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: mjswan-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 23.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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}

File hashes

Hashes for mjswan-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6595ad5ca416c8e1324b2bcd3528248ff39fe6f2f91c7036c084dec3aff4811b
MD5 30afb10bf7eca25484629115ca0414e9
BLAKE2b-256 f834e43c6176cb4f8ac4f5ffdaa53d3cc3410fc71bbf9ee5069475b97baede72

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.4

2 files

This release

0.9.3 This release

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.3.0

2 files

0.2.5

2 files

0.2.4

2 files

0.2.2

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 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