File size: 5,018 Bytes
1a59c60 | 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | # 2. LeRobot Setting
last updated Dec/26/2025
## 2-1. USB port ์ฐพ๊ธฐ
1) Follower arm ๋ณด๋์ PC๋ฅผ USB๋ก ์ฐ๊ฒฐ
2) ์๋ ๋ช
๋ น ์คํ
```bash
lerobot-find-port
```
3) ์๋ด์ ๋ฐ๋ผ **Follower arm ๋ณด๋์์ USB ์ผ์ด๋ธ์ ๋ฝ๊ณ Enter**๋ฅผ ๋๋ฅด๋ฉด, ์๋์ ๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
```text
The port of this MotorsBus is '/dev/ttyACM0'
Reconnect the USB cable
```
โ ์ด ๊ฒฝ์ฐ์ follower arm ๋ณด๋์ USB ํฌํธ๋ **`/dev/ttyACM0`** ์
๋๋ค.
4) Leader arm ๋ณด๋๋ ๋ง์ฐฌ๊ฐ์ง๋ก USB ํฌํธ๋ฅผ ์ฐพ์์ค๋๋ค.
5) ๊ฐ ํฌํธ๊ฐ ์ด๋ค arm(Follower/Leader)์ ํด๋นํ๋์ง **๋ฐ๋์ ๊ตฌ๋ถ**ํด ๋์ธ์.
6) ์ฐ๊ฒฐ๋ USB ํฌํธ์ Read/Write ๊ถํ ๋ถ์ฌ
```bash
sudo chmod 666 /dev/ttyACM0
sudo chmod 666 /dev/ttyACM1
```
## (Optional) Serial number๋ฅผ ๊ธฐ๋ฐ์ผ๋ก USB port ๊ณ ์ ํ๋ ๋ฒ
### 1. ttyACM0 serial ํ์ธ
```bash
udevadm info -a -n /dev/ttyACM0 | grep '{serial}' -m 1
```
```bash
# Example print
ATTRS{serial}=="5A7A057786"
```
### 2. ttyACM1 serial ํ์ธ
```bash
udevadm info -a -n /dev/ttyACM1 | grep '{serial}' -m 1
```
```bash
# Example print
ATTRS{serial}=="5A68011549"
```
### 3. udev rule ์์ฑ
```bash
# udev rule ์์ฑ/ํธ์ง
sudo nano /etc/udev/rules.d/99-serial.rules
```
```bash
GNU nano 2.9.3 /etc/udev/rules.d/99-serial.rules
# ์๋์ serial number๋ ์์์
๋๋ค. ์์ ์ ํ๊ฒฝ์์ ํ์ธํ ๊ฐ์ผ๋ก ๋ฐ๋์ ๊ต์ฒดํ์ธ์.
SUBSYSTEM=="tty", ATTRS{serial}=="5A7A057786", SYMLINK+="so101_follower"
SUBSYSTEM=="tty", ATTRS{serial}=="5A68011549", SYMLINK+="so101_leader"
```
### 4. rule reload / trigger
```bash
sudo udevadm control --reload-rules
sudo udevadm trigger
```
### 5. ๊ณ ์ ํฌํธ ํ์ธ
```bash
ls -l /dev/so101_*
```
```bash
# Example print
# USB ํฌํธ๋ฅผ ๊ฝ๋ ์์๊ฐ ๋ฐ๋์ด๋ ๋ค์ ๊ฒฝ๋ก๋ก ํญ์ ๋์ผํ๊ฒ ์ธ์
lrwxrwxrwx 1 root root 7 11์ 24 21:46 /dev/so101_follower -> ttyACM0
lrwxrwxrwx 1 root root 7 11์ 24 21:46 /dev/so101_leader -> ttyACM1
```
---
## 2-2. ๋ชจํฐ ID ์ค์
- ๊ฐ ๋ชจํฐ์ **๊ณ ์ ID** ์ค์ ์ ์ํด ์๋ ๋ช
๋ น์ด ์คํ ํ, ํฐ๋ฏธ๋์ ํ์๋๋ ๊ฐ์ด๋์ ๋ฐ๋ผ **๋ชจํฐ๋ฅผ ์์๋๋ก ์ฐ๊ฒฐ**ํ๋ฉฐ ์งํ
- ์๋ ๋งํฌ์ ์์์ ๋ณด๋ฉด์ ํ๋ ๊ฑธ ์ถ์ฒํฉ๋๋ค. \
https://huggingface.co/docs/lerobot/so101#2-set-the-motors-ids-and-baudrates
### Follower
```bash
lerobot-setup-motors \
--robot.type=so101_follower \
--robot.port=/dev/so101_follower # Follower ๋ณด๋์ USB port
```
### Leader
```bash
lerobot-setup-motors \
--teleop.type=so101_leader \
--teleop.port=/dev/so101_leader # Leader ๋ณด๋์ USB port
```
---
## 2-3. Calibration
- Calibration์ ๋ก๋ด ํ์ ๊ฐ ๊ด์ (joint)์ด ์ ํํ ์์น๋ฅผ ์ธ์ํ๊ณ ๋งคํํ ์ ์๋๋ก ํ๋ ์ค์ํ ๊ณผ์ ์
๋๋ค.
- ์๋ ๋งํฌ์ ์์์ ๋ณด๋ฉด์ ํ๋ ๊ฑธ ์ถ์ฒํฉ๋๋ค. \
https://huggingface.co/docs/lerobot/so101#calibrate
### Follower
```bash
lerobot-calibrate \
--robot.type=so101_follower \
--robot.port=/dev/so101_follower \
--robot.id=follower
```
### Leader
```bash
lerobot-calibrate \
--teleop.type=so101_leader \
--teleop.port=/dev/so101_leader \
--teleop.id=leader
```
### Calibration ๊ณผ์
Command ์คํ ํ ๋ค์๊ณผ ๊ฐ์ ๋ฉ์์ง๊ฐ ํ์๋ฉ๋๋ค.
```text
Move None SO101Leader to the middle of its range of motion and press ENTER....
Move all joints sequentially through their entire ranges of motion.
Recording positions. Press ENTER to stop...
```
์ ๋ฉ์์ง๋ฅผ ๋ฐ๋ผ **์ค๊ฐ ์์น(middle position)** ๋ฅผ ์ก์์ฃผ๊ณ **Enter**๋ฅผ ๋๋ฌ์ฃผ์ธ์.
#### Joint ์์ง์ ์ฒดํฌ๋ฆฌ์คํธ
- ๋ก๋ด ํ์ **์ค๊ฐ ์์น(middle position)** ๋ก ์ด๋
- ๋ชจ๋ ๊ด์ (joints)์ **์์ฐจ์ ์ผ๋ก** ์ ์ฒด ๋ฒ์์์ ์์ง์ฌ๋ณด๊ธฐ
- **ENTER** ํค๋ฅผ ๋๋ฌ ๊ธฐ๋ก ์ค์ง
### Calibration ๊ฒฐ๊ณผ
Calibration์ด ์๋ฃ๋๋ฉด ๋ค์๊ณผ ๊ฐ์ ๊ด์ ์์น ์ ๋ณด๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค(์์).
```bash
-------------------------------------------
-------------------------------------------
NAME | MIN | POS | MAX
shoulder_pan | 1955 | 2007 | 3132
shoulder_lift | 709 | 724 | 2057
elbow_flex | 1605 | 3036 | 3110
wrist_flex | 808 | 2797 | 2803
wrist_roll | 2037 | 2048 | 2055
gripper | 2019 | 2046 | 3383
```
### ํ์ผ ์ ์ฅ ํ์ธ
์ฑ๊ณต์ ์ผ๋ก ์๋ฃ๋๋ฉด ๋ค์ ๋ฉ์์ง๊ฐ ํ์๋ฉ๋๋ค.
```bash
Calibration saved to ~/.cache/huggingface/lerobot/calibration/teleoperators/so101_leader/leader.json
```
### Calibration ํ์ผ
Calibration์ด ์๋ฃ๋๋ฉด ๋ค์ ์์น์ ํ์ผ์ด ์ ์ฅ๋ฉ๋๋ค.
- ๋ฆฌ๋ ์:
`~/.cache/huggingface/lerobot/calibration/teleoperators/so101_leader/leader.json`
- ํ๋ก์ ์:
`~/.cache/huggingface/lerobot/calibration/robots/so101_follower/follower.json`
๊ฐ Calibration ํ์ผ์๋ ๋ค์ ์ ๋ณด๊ฐ ํฌํจ๋ฉ๋๋ค.
- ๊ฐ ๊ด์ ์ ์ต์๊ฐ(MIN)
- ํ์ฌ ์์น(POS)
- ์ต๋๊ฐ(MAX)
---
|