# 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) ---