NERDDISCO commited on
Commit
0f698f8
·
1 Parent(s): fe6e2a2

docs: refactored README to make it more clear and aligned with the other README's

Browse files
Files changed (1) hide show
  1. packages/cli/README.md +54 -62
packages/cli/README.md CHANGED
@@ -1,42 +1,68 @@
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
 
 
 
 
 
 
 
 
 
13
  lerobot find-port
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ```
15
 
16
  ## Commands
17
 
18
- ### Find Port
19
 
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:
27
 
28
- 1. Lists initial ports
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
- ### Calibrate
35
 
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,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
- **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:**
@@ -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` - Motor 1 up/down
79
- - `a/d` - Motor 2 left/right
80
- - `q/e` - Motor 3 up/down
81
- - `r/f` - Motor 4 forward/back
82
- - `t/g` - Motor 5 up/down
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:**
@@ -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)