AMD LeRobot Challenge Development Guide
This document records the complete workflow for robot development using the AMD LeRobot platform, prepared for the AMD Robotics Hackathon. It covers everything from environment setup, dual-arm robot (Leader-Follower) calibration, and teleoperation configuration, to dataset recording and uploading. I also document my experience with hardware maintenance, specifically replacing damaged motors.
1. Environment Configuration
1.1 Installing LeRobot
First, clone the LeRobot repository from GitHub and install the dependencies.
1 | git clone https://github.com/huggingface/lerobot.git |
1.2 Port Identification
After connecting the robots, you need to identify the serial ports corresponding to the Leader and the Follower.
1 | ls /dev/tty.* |
Distinguish them by device ID:
- Leader:
/dev/tty.usbmodem5AE60848661 - Follower:
/dev/tty.usbmodem5AE60570611
Note: The IDs above are examples. Please refer to the
lscommand output for your actual device IDs.
2. Robot Calibration
Before performing any operations, the robotic arms must be calibrated.
2.1 Calibrating the Leader
1 | lerobot-calibrate \ |
2.2 Calibrating the Follower
1 | lerobot-calibrate \ |
3. Teleoperation
Teleoperation is a core feature of LeRobot, allowing you to control the Follower via the Leader.
3.1 No Display Mode
Suitable for low-latency operations where real-time video feedback is not required.
1 | lerobot-teleoperate \ |
3.2 With UI Display
Enables the UI interface to facilitate observation of joint states.
1 | lerobot-teleoperate \ |
3.3 Multi-Camera Configuration
For Visual Imitation Learning, multiple cameras need to be configured.
Step 1: Confirm Camera Indices
Use the following Python script to iterate through and display all available cameras, noting the index ID for different views.
1 | import cv2 |
Typical Configuration:
index_0: Side View, 30fpsindex_1: Top View, 25fpsindex_2: Arm View, 30fps
Tip: You can also use the
lerobot-find-cameras opencvcommand to find cameras.
Step 2: Teleoperation with Cameras
Specify the path and resolution for each camera in the configuration parameters.
1 | lerobot-teleoperate \ |
4. Record Dataset
4.1 Hugging Face Authentication
To upload datasets, you first need to log in to Hugging Face.
1 | # Login (Token required) |
4.2 Recording Process
Test Recording (No Upload):
Record a small amount of data (e.g., 3 episodes) to verify system stability.
1 | lerobot-record \ |
Formal Recording (With Upload):
Record 100 episodes and upload automatically.
1 | lerobot-record \ |
Operation Shortcuts:
->(Right Arrow): Save current episode and start the next one<-(Left Arrow): Discard current episode and re-recordESC: Exit recording
4.3 Dataset Management
Merge Datasets:
1 | lerobot-edit-dataset \ |
Manual Upload:
1 | hf repo create "cfu/record_test_ball" --repo-type dataset --exist-ok |
5. Hardware Maintenance: Replacing Motors and Resetting IDs
During a mishap, the #4 motor of the Follower was damaged. After replacing it with a new motor, the new motor’s ID defaults to 1 and needs to be changed to 4 to be correctly identified by the system.
5.1 Check Motor ID
Use the following script to scan for motors on the bus.
1 | from scservo_sdk import PortHandler, PacketHandler, COMM_SUCCESS |
5.2 Modify Motor ID
Complete script to change ID from 1 to 4:
1 | from scservo_sdk import PortHandler, PacketHandler, COMM_SUCCESS |
With these steps complete, we have covered everything from software environment setup to hardware maintenance, allowing us to focus on the development of robot control algorithms.