Skip to main content

Robola MJCF Editor Local Bridge - Local Python Library for MuJoCo and Online Web mjcf editing

Project description

Robola – Local MuJoCo Runtime Companion

RobolaPyLib powers the local runtime that feeds the Robola Web Editor:

  • Load and validate MuJoCo MJCF scenes on your own machine
  • Stream geometry/material/joint data to the browser in real time
  • Expose a WebSocket API for simulation control, saving, and asset transfer

✅ Use the online editor at https://robolaweb.com/editor. The website never touches your disk—the CLI in this repo loads every file locally and only streams the data you approve.


Installation

From PyPI (recommended)

pip install robola

From source (development)

git clone https://github.com/robola-dev/RobolaPyLib.git
cd RobolaPyLib
pip install -e .

Prerequisites:

  • Python 3.10 or later
  • MuJoCo 3.0+ (and its license/key environment variables configured if required)

5-Minute Quickstart

  1. Prepare a model – keep an *.xml MJCF file handy (for example ~/robots/spot.xml).
  2. Start the local server
    robola serve ~/robots/spot.xml --port 9527
    
    • Serves WebSocket traffic on ws://localhost:9527
    • The terminal banner confirms that the runtime is up
  3. Open the online editor – visit https://robolaweb.com/editor and sign in.
  4. Connect to the runtime – enter 9527 in the “WebSocket Port” field (top-right) and click Connect.
  5. Model, simulate, iterate
    • The editor fetches the local model and renders the scene
    • You can inspect/edit bodies, joints, materials, etc.
    • Start/pause/stop simulations or save back to disk from the browser

📌 Keep the CLI process running while the browser tab is open so the editor can stream frames and send commands.


CLI Usage

# Load a model with the default port (9527)
robola serve /path/to/model.xml

# Use a custom port
robola serve /path/to/model.xml --port 9000

# Restrict CORS origins (production)
robola serve /path/to/model.xml --origin https://robolaweb.com

# Tune streaming rate and logging
robola serve /path/to/model.xml --fps 30

Common Options

Option Description Default
--port WebSocket listening port 9527
--origin Allowed browser origin (CORS) * (set to https://robolaweb.com when sharing)
--fps Simulation streaming rate (1–60 Hz) 30

Embedding via Python

from robola import serve

serve(
    mjcf_path="/abs/path/to/model.xml",
    port=9527,
    allowed_origin="https://robolaweb.com",
    fps=30,
)

Call serve() inside a notebook, a script, or your own application to reuse the same local WebSocket protocol that the CLI exposes.


Troubleshooting

Symptom Likely cause Fix
“Unable to connect” in the editor Port/origin mismatch Ensure the CLI --port and --origin match the values entered in the editor
Simulation crashes on start Missing meshes/textures referenced by MJCF Check the terminal logs and verify every asset path is valid relative to the MJCF file
Saving fails File not writable Confirm the XML can be written and that the CLI is still running

⚠️ Current limitation: Robola does not support MuJoCo Flex (soft bodies) or height-field (hfield) based terrain rendering yet. These assets will be ignored/omitted when streaming to the editor.


License

MIT License. PRs and issues are welcome—help more roboticists build faster with Robola. 🤖🚀

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

robola-0.1.0.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

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

robola-0.1.0-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file robola-0.1.0.tar.gz.

File metadata

  • Download URL: robola-0.1.0.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for robola-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d430df722f3e9dcecca31ca996b0f1077aca73f91e1c4293c823daf7524af658
MD5 619235ebb0ae7cbd38e6c6d910fe2577
BLAKE2b-256 20946d0800c1f9abbb2d95ec806028b69bcbd8f5f3cf12fbc4b324452b0577db

See more details on using hashes here.

File details

Details for the file robola-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: robola-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for robola-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15c5e77f95ff2697ff34a45470508a51226ccd801cfde0b7ef269d8ce4906ed3
MD5 c99d6c6c2f5743f78c94c018a79ebd39
BLAKE2b-256 e2fb74e2b662bde021168c0fbb62dfc0ed0a207ab5780a32e940cc71e32fa273

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