Spaces:
Running
Running
docs: refactored README to make it more clear and aligned with the other README's
Browse files- packages/cli/README.md +54 -62
packages/cli/README.md
CHANGED
|
@@ -1,42 +1,68 @@
|
|
| 1 |
# lerobot
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
##
|
| 6 |
|
| 7 |
```bash
|
| 8 |
-
#
|
| 9 |
-
npx lerobot@latest find-port
|
| 10 |
-
|
| 11 |
-
# Or install globally
|
| 12 |
npm install -g lerobot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
lerobot find-port
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
```
|
| 15 |
|
| 16 |
## Commands
|
| 17 |
|
| 18 |
-
###
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
```bash
|
| 23 |
-
|
| 24 |
```
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
1. Lists
|
| 29 |
2. Prompts to unplug USB cable
|
| 30 |
3. Detects which port disappeared
|
| 31 |
4. Prompts to reconnect cable
|
| 32 |
-
5. Verifies port is restored
|
| 33 |
|
| 34 |
-
###
|
| 35 |
|
| 36 |
-
Calibrate robot motors and save calibration data
|
| 37 |
|
| 38 |
```bash
|
| 39 |
-
|
| 40 |
```
|
| 41 |
|
| 42 |
**Options:**
|
|
@@ -46,22 +72,18 @@ npx lerobot@latest calibrate --robot.type=so100_follower --robot.port=/dev/ttyUS
|
|
| 46 |
- `--robot.id` - Robot identifier (default: `default`)
|
| 47 |
- `--output` - Custom output path for calibration file
|
| 48 |
|
| 49 |
-
**
|
| 50 |
-
|
| 51 |
-
Calibration files are saved to the same location as Python lerobot:
|
| 52 |
|
| 53 |
```
|
| 54 |
~/.cache/huggingface/lerobot/calibration/robots/{robot_type}/{robot_id}.json
|
| 55 |
```
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
### Teleoperate
|
| 60 |
|
| 61 |
-
Control robot through keyboard
|
| 62 |
|
| 63 |
```bash
|
| 64 |
-
|
| 65 |
```
|
| 66 |
|
| 67 |
**Options:**
|
|
@@ -70,27 +92,23 @@ npx lerobot@latest teleoperate --robot.type=so100_follower --robot.port=/dev/tty
|
|
| 70 |
- `--robot.port` - Serial port (e.g., `/dev/ttyUSB0`, `COM4`)
|
| 71 |
- `--robot.id` - Robot identifier (default: `default`)
|
| 72 |
- `--teleop.type` - Teleoperator type (default: `keyboard`)
|
| 73 |
-
- `--teleop.stepSize` - Step size for keyboard control (default: `25`)
|
| 74 |
- `--duration` - Duration in seconds, 0 = unlimited (default: `0`)
|
| 75 |
|
| 76 |
-
**Controls:**
|
| 77 |
|
| 78 |
-
- `w/s` -
|
| 79 |
-
- `a/d` -
|
| 80 |
-
- `q/e` -
|
| 81 |
-
- `
|
| 82 |
-
- `
|
| 83 |
-
- `y/h` - Motor 6 open/close
|
| 84 |
- `Ctrl+C` - Stop and exit
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
### Release Motors
|
| 89 |
|
| 90 |
-
Release robot motors for manual
|
| 91 |
|
| 92 |
```bash
|
| 93 |
-
|
| 94 |
```
|
| 95 |
|
| 96 |
**Options:**
|
|
@@ -99,29 +117,3 @@ npx lerobot@latest release-motors --robot.type=so100_follower --robot.port=/dev/
|
|
| 99 |
- `--robot.port` - Serial port (e.g., `/dev/ttyUSB0`, `COM4`)
|
| 100 |
- `--robot.id` - Robot identifier (default: `default`)
|
| 101 |
- `--motors` - Specific motor IDs to release (comma-separated)
|
| 102 |
-
|
| 103 |
-
**Note:** This command is specific to our Node.js implementation for convenient motor management.
|
| 104 |
-
|
| 105 |
-
## Examples
|
| 106 |
-
|
| 107 |
-
### Complete Workflow
|
| 108 |
-
|
| 109 |
-
```bash
|
| 110 |
-
# 1. Find your robot
|
| 111 |
-
npx lerobot@latest find-port
|
| 112 |
-
# Output: Detected port: /dev/ttyUSB0
|
| 113 |
-
|
| 114 |
-
# 2. Calibrate the robot
|
| 115 |
-
npx lerobot@latest calibrate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 116 |
-
|
| 117 |
-
# 3. Control the robot
|
| 118 |
-
npx lerobot@latest teleoperate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm --teleop.type=keyboard
|
| 119 |
-
|
| 120 |
-
# 4. Release motors when done
|
| 121 |
-
npx lerobot@latest release-motors --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 122 |
-
```
|
| 123 |
-
|
| 124 |
-
## Related Packages
|
| 125 |
-
|
| 126 |
-
- **[@lerobot/node](../node/)** - Node.js library based on serialport
|
| 127 |
-
- **[@lerobot/web](../web/)** - Browser library for web applications based on WebSerial and WebUSB
|
|
|
|
| 1 |
# lerobot
|
| 2 |
|
| 3 |
+
Command-line interface for robot control with [@lerobot/node](https://www.npmjs.com/package/@lerobot/node) in Node.js (see [@lerobot/web](https://www.npmjs.com/package/@lerobot/web) for the browser version).
|
| 4 |
|
| 5 |
+
## Quick Start
|
| 6 |
|
| 7 |
```bash
|
| 8 |
+
# Install globally
|
|
|
|
|
|
|
|
|
|
| 9 |
npm install -g lerobot
|
| 10 |
+
|
| 11 |
+
# Or use directly with npx
|
| 12 |
+
npx lerobot@latest --help
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
### Complete Workflow
|
| 16 |
+
|
| 17 |
+
```bash
|
| 18 |
+
# 1. Find your robot port
|
| 19 |
lerobot find-port
|
| 20 |
+
# Output: The port of this MotorsBus is '/dev/ttyUSB0'
|
| 21 |
+
|
| 22 |
+
# 2. Calibrate the robot
|
| 23 |
+
lerobot calibrate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 24 |
+
|
| 25 |
+
# 3. Control the robot
|
| 26 |
+
lerobot teleoperate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 27 |
+
|
| 28 |
+
# 4. Release motors when done
|
| 29 |
+
lerobot release-motors --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
### Help
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
# See all available commands
|
| 36 |
+
lerobot --help
|
| 37 |
+
|
| 38 |
+
# Get help for specific commands
|
| 39 |
+
lerobot calibrate --help
|
| 40 |
+
lerobot teleoperate --help
|
| 41 |
```
|
| 42 |
|
| 43 |
## Commands
|
| 44 |
|
| 45 |
+
### `find-port`
|
| 46 |
|
| 47 |
+
Interactive port discovery using cable detection.
|
| 48 |
|
| 49 |
```bash
|
| 50 |
+
lerobot find-port
|
| 51 |
```
|
| 52 |
|
| 53 |
+
**Process:**
|
| 54 |
|
| 55 |
+
1. Lists current ports
|
| 56 |
2. Prompts to unplug USB cable
|
| 57 |
3. Detects which port disappeared
|
| 58 |
4. Prompts to reconnect cable
|
|
|
|
| 59 |
|
| 60 |
+
### `calibrate`
|
| 61 |
|
| 62 |
+
Calibrate robot motors and save calibration data.
|
| 63 |
|
| 64 |
```bash
|
| 65 |
+
lerobot calibrate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 66 |
```
|
| 67 |
|
| 68 |
**Options:**
|
|
|
|
| 72 |
- `--robot.id` - Robot identifier (default: `default`)
|
| 73 |
- `--output` - Custom output path for calibration file
|
| 74 |
|
| 75 |
+
**Storage Location:**
|
|
|
|
|
|
|
| 76 |
|
| 77 |
```
|
| 78 |
~/.cache/huggingface/lerobot/calibration/robots/{robot_type}/{robot_id}.json
|
| 79 |
```
|
| 80 |
|
| 81 |
+
### `teleoperate`
|
|
|
|
|
|
|
| 82 |
|
| 83 |
+
Control robot through keyboard input.
|
| 84 |
|
| 85 |
```bash
|
| 86 |
+
lerobot teleoperate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 87 |
```
|
| 88 |
|
| 89 |
**Options:**
|
|
|
|
| 92 |
- `--robot.port` - Serial port (e.g., `/dev/ttyUSB0`, `COM4`)
|
| 93 |
- `--robot.id` - Robot identifier (default: `default`)
|
| 94 |
- `--teleop.type` - Teleoperator type (default: `keyboard`)
|
|
|
|
| 95 |
- `--duration` - Duration in seconds, 0 = unlimited (default: `0`)
|
| 96 |
|
| 97 |
+
**Keyboard Controls:**
|
| 98 |
|
| 99 |
+
- `w/s` - Elbow flex/extend
|
| 100 |
+
- `a/d` - Wrist down/up
|
| 101 |
+
- `q/e` - Wrist roll left/right
|
| 102 |
+
- `o/c` - Gripper open/close
|
| 103 |
+
- `Arrow keys` - Shoulder lift/pan
|
|
|
|
| 104 |
- `Ctrl+C` - Stop and exit
|
| 105 |
|
| 106 |
+
### `release-motors`
|
|
|
|
|
|
|
| 107 |
|
| 108 |
+
Release robot motors for manual positioning.
|
| 109 |
|
| 110 |
```bash
|
| 111 |
+
lerobot release-motors --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_arm
|
| 112 |
```
|
| 113 |
|
| 114 |
**Options:**
|
|
|
|
| 117 |
- `--robot.port` - Serial port (e.g., `/dev/ttyUSB0`, `COM4`)
|
| 118 |
- `--robot.id` - Robot identifier (default: `default`)
|
| 119 |
- `--motors` - Specific motor IDs to release (comma-separated)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|