Spaces:
Running
Running
docs: use "npx lerobot@latst"
Browse files- packages/cli/README.md +26 -92
packages/cli/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
# lerobot
|
2 |
|
3 |
-
|
4 |
|
5 |
-
##
|
6 |
|
7 |
```bash
|
8 |
-
# Use directly with npx
|
9 |
-
npx lerobot find-port
|
10 |
|
11 |
# Or install globally
|
12 |
npm install -g lerobot
|
@@ -20,8 +20,7 @@ lerobot find-port
|
|
20 |
Discover robot port with interactive cable detection. Matches Python lerobot's `find_port.py` exactly.
|
21 |
|
22 |
```bash
|
23 |
-
|
24 |
-
lerobot find-port
|
25 |
```
|
26 |
|
27 |
This command follows Python lerobot's behavior exactly:
|
@@ -37,10 +36,7 @@ This command follows Python lerobot's behavior exactly:
|
|
37 |
Calibrate robot motors and save calibration data to Hugging Face cache.
|
38 |
|
39 |
```bash
|
40 |
-
lerobot calibrate
|
41 |
-
--robot.type=so100_follower \
|
42 |
-
--robot.port=/dev/ttyUSB0 \
|
43 |
-
--robot.id=my_follower_arm
|
44 |
```
|
45 |
|
46 |
**Options:**
|
@@ -50,17 +46,22 @@ lerobot calibrate \
|
|
50 |
- `--robot.id` - Robot identifier (default: `default`)
|
51 |
- `--output` - Custom output path for calibration file
|
52 |
|
53 |
-
**Compatible with:** `python -m lerobot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
### Teleoperate
|
56 |
|
57 |
Control robot through keyboard teleoperation.
|
58 |
|
59 |
```bash
|
60 |
-
lerobot teleoperate
|
61 |
-
--robot.type=so100_follower \
|
62 |
-
--robot.port=/dev/ttyUSB0 \
|
63 |
-
--robot.id=my_follower_arm
|
64 |
```
|
65 |
|
66 |
**Options:**
|
@@ -82,17 +83,14 @@ lerobot teleoperate \
|
|
82 |
- `y/h` - Motor 6 open/close
|
83 |
- `Ctrl+C` - Stop and exit
|
84 |
|
85 |
-
**Compatible with:** `python -m lerobot
|
86 |
|
87 |
### Release Motors
|
88 |
|
89 |
Release robot motors for manual movement.
|
90 |
|
91 |
```bash
|
92 |
-
lerobot release-motors
|
93 |
-
--robot.type=so100_follower \
|
94 |
-
--robot.port=/dev/ttyUSB0 \
|
95 |
-
--robot.id=my_follower_arm
|
96 |
```
|
97 |
|
98 |
**Options:**
|
@@ -102,92 +100,28 @@ lerobot release-motors \
|
|
102 |
- `--robot.id` - Robot identifier (default: `default`)
|
103 |
- `--motors` - Specific motor IDs to release (comma-separated)
|
104 |
|
105 |
-
**
|
106 |
-
|
107 |
-
## Python lerobot Compatibility
|
108 |
-
|
109 |
-
This CLI provides 100% compatible commands with Python lerobot:
|
110 |
-
|
111 |
-
| Python lerobot | Node.js lerobot | Status |
|
112 |
-
| ---------------------------------- | ---------------------------- | ------------- |
|
113 |
-
| `python -m lerobot find_port` | `npx lerobot find-port` | ✅ Compatible |
|
114 |
-
| `python -m lerobot calibrate` | `npx lerobot calibrate` | ✅ Compatible |
|
115 |
-
| `python -m lerobot teleoperate` | `npx lerobot teleoperate` | ✅ Compatible |
|
116 |
-
| `python -m lerobot release-motors` | `npx lerobot release-motors` | ✅ Compatible |
|
117 |
-
|
118 |
-
### Calibration Data Compatibility
|
119 |
-
|
120 |
-
Calibration files are saved to the same location as Python lerobot:
|
121 |
-
|
122 |
-
```
|
123 |
-
~/.cache/huggingface/lerobot/calibration/robots/{robot_type}/{robot_id}.json
|
124 |
-
```
|
125 |
-
|
126 |
-
This ensures calibration data is shared between Python and Node.js implementations.
|
127 |
|
128 |
## Examples
|
129 |
|
130 |
### Complete Workflow
|
131 |
|
132 |
```bash
|
133 |
-
# 1. Find your robot
|
134 |
-
npx lerobot find-port
|
135 |
# Output: Detected port: /dev/ttyUSB0
|
136 |
|
137 |
# 2. Calibrate the robot
|
138 |
-
npx lerobot calibrate
|
139 |
-
--robot.type=so100_follower \
|
140 |
-
--robot.port=/dev/ttyUSB0 \
|
141 |
-
--robot.id=my_arm
|
142 |
|
143 |
# 3. Control the robot
|
144 |
-
npx lerobot teleoperate
|
145 |
-
--robot.type=so100_follower \
|
146 |
-
--robot.port=/dev/ttyUSB0 \
|
147 |
-
--robot.id=my_arm
|
148 |
|
149 |
# 4. Release motors when done
|
150 |
-
npx lerobot release-motors
|
151 |
-
--robot.type=so100_follower \
|
152 |
-
--robot.port=/dev/ttyUSB0 \
|
153 |
-
--robot.id=my_arm
|
154 |
-
```
|
155 |
-
|
156 |
-
### Automation Scripts
|
157 |
-
|
158 |
-
```bash
|
159 |
-
#!/bin/bash
|
160 |
-
# Automated calibration script
|
161 |
-
|
162 |
-
ROBOT_TYPE="so100_follower"
|
163 |
-
ROBOT_PORT="/dev/ttyUSB0"
|
164 |
-
ROBOT_ID="production_arm_1"
|
165 |
-
|
166 |
-
echo "Starting automated calibration..."
|
167 |
-
npx lerobot calibrate \
|
168 |
-
--robot.type=$ROBOT_TYPE \
|
169 |
-
--robot.port=$ROBOT_PORT \
|
170 |
-
--robot.id=$ROBOT_ID
|
171 |
-
|
172 |
-
echo "Calibration complete. Starting teleoperation..."
|
173 |
-
npx lerobot teleoperate \
|
174 |
-
--robot.type=$ROBOT_TYPE \
|
175 |
-
--robot.port=$ROBOT_PORT \
|
176 |
-
--robot.id=$ROBOT_ID \
|
177 |
-
--duration=60 # Run for 60 seconds
|
178 |
```
|
179 |
|
180 |
-
## Requirements
|
181 |
-
|
182 |
-
- Node.js 18+
|
183 |
-
- Compatible with Windows, macOS, and Linux
|
184 |
-
- Same hardware requirements as Python lerobot
|
185 |
-
|
186 |
## Related Packages
|
187 |
|
188 |
-
- **[@lerobot/node](../node/)** - Node.js library
|
189 |
-
- **[@lerobot/web](../web/)** - Browser library for web applications
|
190 |
-
|
191 |
-
## License
|
192 |
-
|
193 |
-
Apache-2.0
|
|
|
1 |
# lerobot
|
2 |
|
3 |
+
Control robots with Node.js (serialport) on the CLI, inspired by [LeRobot](https://github.com/huggingface/lerobot)
|
4 |
|
5 |
+
## Install
|
6 |
|
7 |
```bash
|
8 |
+
# Use directly with npx
|
9 |
+
npx lerobot@latest find-port
|
10 |
|
11 |
# Or install globally
|
12 |
npm install -g lerobot
|
|
|
20 |
Discover robot port with interactive cable detection. Matches Python lerobot's `find_port.py` exactly.
|
21 |
|
22 |
```bash
|
23 |
+
npx lerobot@latest find-port
|
|
|
24 |
```
|
25 |
|
26 |
This command follows Python lerobot's behavior exactly:
|
|
|
36 |
Calibrate robot motors and save calibration data to Hugging Face cache.
|
37 |
|
38 |
```bash
|
39 |
+
npx lerobot@latest calibrate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_follower_arm
|
|
|
|
|
|
|
40 |
```
|
41 |
|
42 |
**Options:**
|
|
|
46 |
- `--robot.id` - Robot identifier (default: `default`)
|
47 |
- `--output` - Custom output path for calibration file
|
48 |
|
49 |
+
**Compatible with:** `python -m lerobot.calibrate`
|
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 |
+
This ensures calibration data is shared between Python and Node.js implementations.
|
58 |
|
59 |
### Teleoperate
|
60 |
|
61 |
Control robot through keyboard teleoperation.
|
62 |
|
63 |
```bash
|
64 |
+
npx lerobot@latest teleoperate --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_follower_arm
|
|
|
|
|
|
|
65 |
```
|
66 |
|
67 |
**Options:**
|
|
|
83 |
- `y/h` - Motor 6 open/close
|
84 |
- `Ctrl+C` - Stop and exit
|
85 |
|
86 |
+
**Compatible with:** `python -m lerobot.teleoperate`
|
87 |
|
88 |
### Release Motors
|
89 |
|
90 |
Release robot motors for manual movement.
|
91 |
|
92 |
```bash
|
93 |
+
npx lerobot@latest release-motors --robot.type=so100_follower --robot.port=/dev/ttyUSB0 --robot.id=my_follower_arm
|
|
|
|
|
|
|
94 |
```
|
95 |
|
96 |
**Options:**
|
|
|
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
|
|
|
|
|
|
|
|