--- title: RMScript Web Demo emoji: 🤖 colorFrom: purple colorTo: blue sdk: docker app_port: 7860 pinned: false --- # RMScript Web Demo Web-based IDE for writing, verifying, and executing rmscript code on Reachy Mini. ## Architecture - **Frontend** (`frontend/`): HTML/CSS/JavaScript editor with live compilation and robot control - **Backend** (`backend/`): FastAPI server for rmscript compilation and validation - **Robot**: Reachy Mini robot daemon running on localhost:8000 ## Quick Start ### On HuggingFace Spaces Just open the Space - the web IDE will load automatically. **Requirements:** - Reachy Mini daemon running on `localhost:8000` on your local machine - Modern web browser with WebSocket support ### Local Development 1. Install rmscript package: ```bash cd rmscript uv sync ``` 2. Start backend server: ```bash cd backend uv sync uv run python app.py ``` 3. Make sure your Reachy Mini daemon is running on `localhost:8000` 4. Open `frontend/index.html` in your web browser ## Features - **Code Editor**: Write rmscript with syntax examples - **Verify Button**: Check script validity without executing - **Execute Button**: Compile and run script on connected robot - **Live Compilation**: See IR (Intermediate Representation) of your script - **Example Scripts**: Load pre-written examples (basic, complex, repeat) - **Real-time Logging**: Console shows compilation errors, warnings, and execution progress ## Usage 1. Write rmscript in the editor (or load an example) 2. Click "Verify" to check syntax and semantics 3. Review any errors/warnings in the console 4. Click "Execute" to run on the robot (robot must be connected) 5. Watch execution progress in the Execution Info panel ## Current Limitations - Sound and picture actions are not yet implemented in execution - **On HuggingFace Spaces**: Due to browser security policies (HTTPS → HTTP localhost), the demo uses a WebSocket fallback instead of the REST API `/goto` endpoint. - Timing is approximated by repeatedly sending the target position over the specified duration - For smoother interpolated movements with proper minimum-jerk trajectories, run the demo locally ## Deployment to HuggingFace Spaces To deploy this demo to HuggingFace Spaces: 1. **Prepare the repository structure:** - Copy the `rmscript` and `reachy_mini` directories into the `rmscript_space_demo` directory: ```bash cd rmscript_space_demo cp -r ../rmscript ./rmscript cp -r ../reachy_mini ./reachy_mini ``` - Your structure should be: ``` rmscript_space_demo/ ├── Dockerfile ├── README.md ├── .dockerignore ├── backend/ ├── frontend/ ├── rmscript/ ← copied source └── reachy_mini/ ← copied source (dependency) ``` 2. **Create a new Space:** - Go to https://huggingface.co/new-space - Select "Docker" as the SDK - Push this directory to your Space repository 3. **The Space will:** - Build the Docker container - Install rmscript and dependencies - Serve the web IDE on port 7860 **Note:** The Space connects to your local robot daemon on `localhost:8000`. Make sure it's running when using the demo. ## Development To modify the demo: - Frontend code: `frontend/app.js` - Backend API: `backend/app.py` - Styling: `frontend/index.html` (embedded CSS)