Teleoperation & Data Collection遥操作与数据采集
On this page本页内容
7. Dual-arm teleoperation check7. 双臂遥操作检查
Run teleoperation before formal data collection to confirm the leader/follower mapping, joint directions and all three camera views:在正式采集前先运行遥操作,确认主从臂对应关系、关节方向和三个相机画面都正确:
lerobot-teleoperate \
--robot.type=bi_so_follower \
--robot.id=follower_arm \
--robot.left_arm_config.port=/dev/ttyACM0 \
--robot.right_arm_config.port=/dev/ttyACM1 \
--robot.left_arm_config.use_degrees=true \
--robot.right_arm_config.use_degrees=true \
--robot.left_arm_config.cameras="{global: {type: opencv, index_or_path: 0, width: 640, height: 480, fps: 30, fourcc: MJPG}, wrist: {type: opencv, index_or_path: 2, width: 640, height: 480, fps: 30, fourcc: MJPG}}" \
--robot.right_arm_config.cameras="{wrist: {type: opencv, index_or_path: 4, width: 640, height: 480, fps: 30, fourcc: MJPG}}" \
--teleop.type=bi_so_leader \
--teleop.id=leader_arm \
--teleop.left_arm_config.port=/dev/ttyACM2 \
--teleop.right_arm_config.port=/dev/ttyACM3 \
--teleop.left_arm_config.use_degrees=true \
--teleop.right_arm_config.use_degrees=true \
--fps=30 \
--display_data=true
If the detected camera indices are not 0 / 2 / 4, update the three index_or_path values.如果相机编号检测结果不是 0 / 2 / 4,修改三个 index_or_path。
8. Task reference images8. 任务参考图
Task reference images are used to restore the scene layout before each episode. The following structure is recommended:任务参考图用于在每个 episode 开始前恢复场景摆放。建议使用以下结构:
BREE/camera_reference/tasks/<task_name>/
├── pic1.jpg
├── pic2.jpg
└── ...
If there is only one reference image, any unambiguous filename can also be used, for example:如果只有一张参考图,也可以使用任意明确的文件名,例如:
BREE/camera_reference/tasks/<task_name>/reference.jpg
9. Data collection9. 数据采集
The following is a unified data-collection template. Before running it, update the dataset name, task description, episode count, durations and reference-image path.下面是一份统一的数据采集模板。运行前必须修改数据集名称、任务描述、episode 数量、时长和参考图路径。
HF_HUB_DISABLE_XET=1 lerobot-record \
--robot.type=bi_so_follower \
--robot.id=follower_arm \
--robot.left_arm_config.port=/dev/ttyACM0 \
--robot.right_arm_config.port=/dev/ttyACM1 \
--robot.left_arm_config.use_degrees=true \
--robot.right_arm_config.use_degrees=true \
--robot.left_arm_config.cameras="{global: {type: opencv, index_or_path: 0, width: 640, height: 480, fps: 30, fourcc: MJPG}, wrist: {type: opencv, index_or_path: 2, width: 640, height: 480, fps: 30, fourcc: MJPG}}" \
--robot.right_arm_config.cameras="{wrist: {type: opencv, index_or_path: 4, width: 640, height: 480, fps: 30, fourcc: MJPG}}" \
--teleop.type=bi_so_leader \
--teleop.id=leader_arm \
--teleop.left_arm_config.port=/dev/ttyACM2 \
--teleop.right_arm_config.port=/dev/ttyACM3 \
--teleop.left_arm_config.use_degrees=true \
--teleop.right_arm_config.use_degrees=true \
--enable_home_hotkey=true \
--home_duration_s=2 \
--display_data=true \
--play_sounds=true \
--dataset.repo_id=YOUR_NAME/YOUR_DATASET \
--dataset.single_task="YOUR TASK DESCRIPTION" \
--dataset.num_episodes=50 \
--dataset.episode_time_s=60 \
--dataset.reset_time_s=40 \
--dataset.push_to_hub=false \
--scene_reference=BREE/camera_reference/tasks/YOUR_TASK \
--scene_reference_camera=global \
--scene_overlay_alpha=0.4 \
--episodes_per_reference=1 \
--scene_home_requires_h=true \
--require_leader_home_alignment=true \
--leader_home_tolerance=8
Reference-image parameters:参考图参数说明:
- When
--scene_referencepoints to a single image, every episode uses that same image.--scene_reference指向单张图片时,每个 episode 使用同一张图。 - When it points to a directory containing files such as
pic1.jpgandpic2.jpg, multiple reference images are used in sequence.指向包含pic1.jpg、pic2.jpg等文件的目录时,按顺序使用多张参考图。 --episodes_per_reference=3means collecting 3 consecutive episodes for each reference image.--episodes_per_reference=3表示每张参考图连续采集 3 个 episode。--scene_overlay_alpha=0.4controls the opacity of the reference-image overlay.--scene_overlay_alpha=0.4控制参考图覆盖透明度。--scene_home_requires_h=truemeans pressingHto return to the H pose before arranging the scene.--scene_home_requires_h=true表示场景整理前需要按H回到 H 位。
Continue to the separate model training guide.下一步请进入独立的模型训练指南。