Spaces:
Running
Running
File size: 2,231 Bytes
756007e 1a430fd 756007e 1a430fd 756007e deaf936 1a430fd deaf936 1a430fd deaf936 fab8624 deaf936 1a430fd deaf936 fab8624 deaf936 1a430fd deaf936 4d3412b deaf936 1a430fd deaf936 1a430fd deaf936 fab8624 deaf936 1a430fd deaf936 1a430fd deaf936 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
---
title: Reachy Mini Basic Example
emoji: π
colorFrom: green
colorTo: green
sdk: static
tags:
- reachy_mini
- reachy_mini_js_app
license: apache-2.0
short_description: Basic standalone HTML example for Reachy Mini
pinned: false
---
# Basic Example
A simple, **standalone** single-file HTML example demonstrating core Reachy Mini functionality.
**No npm install required!** Uses the published package directly from CDN (unpkg).
## Quick Start
1. **Download `index.html`** (just this one file!)
2. **Start a local server** (required for ES modules):
```bash
# Using Python
python3 -m http.server 8080
# Or using npx
npx http-server -p 8080
# Or using npm start
npm start
```
3. **Open in browser**:
```
http://127.0.0.1:8080/index.html
```
4. **Connect your robot**:
- Ensure Reachy Mini is connected via USB, OR
- Start the WebSocket server on `ws://127.0.0.1:8000`
5. **Click "Connect to Robot"** and start controlling!
## How It Works
The example loads `reachy-mini` directly from unpkg CDN:
```javascript
import init, { ... } from 'https://unpkg.com/reachy-mini@0.5.3/index.js';
```
No build tools, no npm install, just one HTML file!
## What This Example Shows
- β
Connecting to Reachy Mini (WebSerial or WebSocket)
- β
Enabling/disabling motor torque
- β
Forward kinematics (joint angles β pose)
- β
Inverse kinematics (pose β joint angles)
- β
Recording and replaying movements
- β
Real-time console output
## Browser Requirements
- Chrome 89+ or Edge 89+ (for WebSerial support)
- Must be served over HTTP/HTTPS (file:// won't work due to ES modules)
## Troubleshooting
**"Failed to resolve module specifier"**
- Make sure you ran `npm install` from the project root
- Verify you're accessing via a web server (not file://)
**"WebSerial not available"**
- Use Chrome or Edge browser
- Check that you're on HTTPS or 127.0.0.1
**"Connection failed"**
- Check USB connection
- Try unplugging/replugging the adapter
- If using WebSocket, ensure server is running on port 8000
## Next Steps
Check out the other examples:
- `examples/simple-test/` - Full-featured control interface
- `examples/blockly/` - Visual programming interface
|