🧪 新教程持续更新中 · 从机械臂到传感器,跟着教程从零搭建
跳到主要内容

第五步:连接摄像头的遥操作(Windows) ​

连接摄像头和电脑 ​

Shell
lerobot-find-cameras opencv

image.png

遥操作并显示摄像头画面 ​

Shell
lerobot-teleoperate --robot.type=so101_follower --robot.port=COM6 --robot.id=my_follower_arm --robot.cameras="{ front: {type: opencv, index_or_path: 1, width: 1280, height: 720, fps: 30, fourcc: "MJPG"}}" --teleop.type=so101_leader --teleop.port=COM7 --teleop.id=my_leader_arm --display_data=true

会打开rerun.io画面,实时显示各个舵机关节的轨迹,以及摄像头实时画面

并保存图像至C:\Users\<你的Windows用户名>\outputs\captured_images目录

image.png

如果遇到了下面这种报错 ​

摄像头连接不上,但在腾讯会议中切换摄像头,仍然能正常开启

image.png

修改lerobot\src\lerobot\cameras\utils.py文件,将OpenCV后端改为cv2.CAP_DSHOW

image.png

这是一个豆包都无法解决的bug,都怪lerobot库封装的太深了,初学者小白很难dubug

wx_camera_1768139334330.mp4

连接多个摄像头,遥操作并显示摄像头画面 ​

Shell
lerobot-teleoperate --robot.type=so101_follower --robot.port=COM6 --robot.id=my_follower_arm --robot.cameras="{ front: {type: opencv, index_or_path: 0, width: 1280, height: 720, fps: 30, fourcc: "MJPG"}, side: {type: opencv, index_or_path: 1, width: 1280, height: 720, fps: 30, fourcc: "MJPG"}}" --teleop.type=so101_leader --teleop.port=COM7 --teleop.id=my_leader_arm --display_data=true

image.png