Metadata-Version: 2.4
Name: mjswan
Version: 0.2.2
Summary: Browser-based MuJoCo simulation with real-time policy control
Project-URL: GitHub, https://github.com/ttktjmt/mjswan
Author: mjswan Developers
License: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: <3.13,>=3.10
Requires-Dist: mujoco==3.6.0
Requires-Dist: nodeenv>=1.9.1
Requires-Dist: onnx>=1.20.0
Requires-Dist: rich>=13.0.0
Requires-Dist: wandb>=0.23.1
Provides-Extra: dev
Requires-Dist: pre-commit>=3.3.2; extra == 'dev'
Requires-Dist: pyright>=1.1.407; extra == 'dev'
Requires-Dist: pytest>=9.0.2; extra == 'dev'
Requires-Dist: ruff>=0.14.9; extra == 'dev'
Provides-Extra: examples
Requires-Dist: gymnasium; extra == 'examples'
Requires-Dist: mjlab>=1.2.0; extra == 'examples'
Requires-Dist: myosuite; extra == 'examples'
Requires-Dist: playground>=0.1.0; extra == 'examples'
Requires-Dist: robot-descriptions>=1.22.0; extra == 'examples'
Requires-Dist: torch>=2.9.1; extra == 'examples'
Description-Content-Type: text/markdown

<p align="center">
  <img src="assets/banner.svg" alt="mjswan" width="60%">
</p>
<p align="center">
  <strong><em>Real-time Interactive AI Robot Simulation in Your Browser</em></strong>
</p>

<p align="center">
  <a href="https://github.com/ttktjmt/mjswan/actions/workflows/deploy.yml"><img src="https://github.com/ttktjmt/mjswan/actions/workflows/deploy.yml/badge.svg" alt="deploy"/></a>
  <a href="https://github.com/ttktjmt/mjswan/actions/workflows/pytest.yml"><img src="https://github.com/ttktjmt/mjswan/actions/workflows/pytest.yml/badge.svg" alt="test"/></a>
  <a href="https://mjswan.readthedocs.io"><img src="https://img.shields.io/readthedocs/mjswan?logo=readthedocs" alt="docs"/></a>
  <a href="https://pypi.org/project/mjswan"><img src="https://img.shields.io/pypi/v/mjswan.svg?logo=pypi" alt="pypi version"></a>
  <a href="https://www.npmjs.com/package/mjswan"><img src="https://img.shields.io/npm/v/mjswan.svg?logo=nodedotjs" alt="npm version"></a>
</p>

<p align="center">
  mjswan is a powerful framework for creating interactive MuJoCo simulations with real-time policy control, running entirely in the browser. Built on top of <a href="https://github.com/google-deepmind/mujoco/tree/main/wasm">mujoco wasm</a>, <a href="https://github.com/microsoft/onnxruntime">onnxruntime</a>, and <a href="https://github.com/mrdoob/three.js/">three.js</a>, it enables easy sharing of AI robot simulation demos as static sites, perfect for GitHub Pages hosting.
</p>

<p align="center">
  <a href="https://ttktjmt.github.io/mjswan/"><img src="assets/demo.gif" width="70%"/></a>
</p>

<p align="center">
  <em>Check out the demo ― <a href="https://ttktjmt.github.io/mjswan/">ttktjmt.github.io/mjswan</a></em>
</p>

<p align="center">
  <a href="https://ttktjmt.github.io/mjswan/myosuite"><img src="https://img.shields.io/badge/MyoSuite-E0E0E0?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMxNTUyNTc7fS5jbHMtMntmaWxsOiNlNmY1ZjA7fTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJMYXllcl8xMCIgZGF0YS1uYW1lPSJMYXllciAxMCI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEsMTNsLTQuMywzLjQ2TDEyLjE3LDkuMzksNy4yOCw2LDEwLjM5LDI2LjJsNi4zMSwxLDYuODctMTAuNDFaTTE1LjY2LDI1LjFsLTMuOS0uNTlMOS4zNCw5Lj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ields.io/badge/MuJoCo_Menagerie-E0E0E0?logo=deepmind" alt="MuJoCo Menagerie Demo"></a>
  &nbsp;
  <a href="https://ttktjmt.github.io/mjswan/playground"><img src="https://img.shields.io/badge/MuJoCo_Playground-E0E0E0?logo=deepmind" alt="MuJoCo Playground Demo"></a>
</p>

---


## 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.
- **Customizable**: Visualize your mujoco models and onnx policies quickly.


## Quick Start

mjswan can be installed with `pip`:
``` sh
pip install mjswan  # or 'mjswan[dev]', 'mjswan[examples]'
```

or with `npm`:
``` sh
npm install mjswan
```

You can run the demo using the `uv` command with the python package `mjswan[examples]`:
```sh
uv run main
```

For detailed installation instructions, visit the [documentation](https://mjswan.readthedocs.io).


## 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.

[MyoSuite License](https://github.com/MyoHub/myosuite/blob/main/LICENSE) ･ [MuJoCo Menagerie License](https://github.com/google-deepmind/mujoco_menagerie/blob/main/LICENSE) ･ [MuJoCo Playground License](https://github.com/google-deepmind/mujoco_playground/blob/main/LICENSE)


## Acknowledgments

This project was greatly inspired by the [Facet project demo](https://facet.pages.dev/) from the research group at Tsinghua University.<br>
It is also built upon the excellent work of [zalo/mujoco_wasm](https://github.com/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](LICENSE). When using mjswan, please retain attribution notices in the app to help other users discover this project.
