# Reachy Mini Simple Control Panel A lightweight, static HTML/JS control panel for Reachy Mini robot using WebSockets for real-time control. ## Features - **Real-time WebSocket Control**: Instant response using WebSocket streaming - **Wake Up / Go to Sleep**: Movement command buttons - **Task Space Control**: Real-time head pose control (X, Y, Z, Roll, Pitch, Yaw) - **Body & Antennas**: Control body yaw and antenna positions - **Auto-reconnect**: Automatically reconnects if connection is lost - **No Dependencies**: Pure HTML/CSS/JavaScript ## How to Use ### Option 1: Open Directly (Simple) Just open `index.html` in your web browser: ```bash open index.html # macOS xdg-open index.html # Linux start index.html # Windows ``` **Note**: The robot daemon must be running on `localhost:8000` ### Option 2: Serve with Python (Recommended for HuggingFace Spaces) ```bash python server.py ``` Then open http://localhost:7860 in your browser. ### Option 3: Serve with any HTTP server ```bash # Using Python 3 python3 -m http.server 7860 # Using Node.js npx http-server -p 7860 # Using PHP php -S localhost:7860 ``` ## Requirements - Reachy Mini daemon running on `localhost:8000` - Modern web browser with WebSocket support - Motors must be enabled before using wake/sleep commands ## Architecture This app uses: - **WebSocket** (`ws://localhost:8000/api/move/ws/set_target`) for real-time pose streaming - **HTTP POST** for wake_up and goto_sleep commands - Pure client-side JavaScript (no backend needed) The app automatically connects to the robot when loaded and reconnects if the connection is lost. ## Deployment on HuggingFace Spaces 1. Copy `index.html`, `app.js`, and `server.py` to your Space 2. Set SDK to `gradio` with sdk_version `6.0.0` (only needed for the server) 3. Or use `static` SDK if HF supports it 4. Users will need to have the robot daemon accessible from their machine ## Technical Details - **Slider Updates**: Use `input` event for real-time updates - **Auto-reconnect**: WebSocket reconnects every 2 seconds if disconnected - **State Management**: Client-side state tracking prevents feedback loops - **Error Handling**: Graceful error messages and automatic recovery