1、介绍:
项目地址:github lerobot:https://github.com/huggingface/lerobot
新版本lerobot,地配置文件需要再lerobot/common/robot_devices/robots/config.py中,有各种机械臂配置文件。贴一下自己的双so100机械臂配置文件。
@RobotConfig.register_subclass("so100")
@dataclass
class So100RobotConfig(ManipulatorRobotConfig):# calibration_dir: str = ".cache/calibration/so100_dual"calibration_dir: str = "/home/hkk/Program/Agent/lerobot/.cache/calibration/so100_dual" ##debug# `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes.# Set this to a positive scalar to have the same value for all motors, or a list that is the same length as# the number of motors in your follower arms.max_relative_target: int | None = Noneleader_arms: dict[str, MotorsBusConfig] = field(default_factory=lambda: {"left": FeetechMotorsBusConfig(port="/dev/ttyACM0",motors={# name: (index, model)"shoulder_pan": [1, "sts3215"],"shoulder_lift": [2, "sts3215"],"elbow_flex": [3, "sts3215"],"wrist_flex": [4, "sts3215"],"wrist_roll": [5, "sts3215"],"gripper": [6, "sts3215"],},),"right": FeetechMotorsBusConfig(port="/dev/ttyACM2",motors={# name: (index, model)"shoulder_pan": [1, "sts3215"],"shoulder_lift": [2, "sts3215"],"elbow_flex": [3, "sts3215"],"wrist_flex": [4, "sts3215"],"wrist_roll": [5, "sts3215"],"gripper": [6, "sts3215"],},),})follower_arms: dict[str, MotorsBusConfig] = field(default_factory=lambda: {"left": FeetechMotorsBusConfig(port="/dev/ttyACM1",motors={# name: (index, model)"shoulder_pan": [1, "sts3215"],"shoulder_lift": [2, "sts3215"],"elbow_flex": [3, "sts3215"],"wrist_flex": [4, "sts3215"],"wrist_roll": [5, "sts3215"],"gripper": [6, "sts3215"],},),"right": FeetechMotorsBusConfig(port="/dev/ttyACM3",motors={# name: (index, model)"shoulder_pan": [1, "sts3215"],"shoulder_lift": [2, "sts3215"],"elbow_flex": [3, "sts3215"],"wrist_flex": [4, "sts3215"],"wrist_roll": [5, "sts3215"],"gripper": [6, "sts3215"],},),})cameras: dict[str, CameraConfig] = field(default_factory=lambda: {"top": OpenCVCameraConfig(camera_index=8,fps=30,width=640,height=480,),# "left": OpenCVCameraConfig(# camera_index=4,# fps=30,# width=640,# height=480,# ),"right": OpenCVCameraConfig(camera_index=10,fps=30,width=640,height=480,),})mock: bool = False
2、硬件介绍
之前版本的电脑4060+ubuntu22.04环境构建夹部署挺好的,服务器上训练,但是推理DP显存不够,至少12G显存好烦,狠心整个5080,安装的是ubuntu22.04,22.04中ultra9是不支持集显,BIOS中只能关掉集显使用独显,电脑开机才不会黑屏。听大佬说inter i系列ubutnu支持集显,lutra系类是新的cpu,需要新的ubutnu,有时间试一试24.04,试过的小伙伴评论区交流下。
安装显卡驱动,官网(下载 NVIDIA 官方驱动 | NVIDIA),找到支持50系列显卡驱动run.570.144等,安装最新的驱动,其它驱动不行的。
使用cuda12.8,低版本的cuda, 50系列Blackwell sm_120暂时不支持,cuda12.6和11.8都试过不行。
创新安装miniconda,根据步骤安装conda环境,最好是先安装torch2.7.0以上版本,之前的版本不支持cuda12.8,pytorch.org官网(PyTorch),4.25号左右,稳定版torch2.7.0+cuda12.8版本已发布,Nightly也行。切记不然跑不了train。
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128# ffmpeg安装的是, 这里不知道啥原因,默认安装ffmpeg==4.3.0,采集数据过程中有奇怪的问题。
conda install ffmpeg==7.1.1 -c conda-forge# conda环境创建好了之后,先执行上面命令,安装torch2.7.0-cuda12.8
# 再:
pip install lerobot -e .....# 不然安装的是torch2.7.0-cu12.6, 不是12.8
3、扩展坞导致不能同时启用多个相机
1)笔记本自带usb相机和红外相机,在程序中过滤掉/dev/Video2端口,IR相机fps是17,通过这个过滤掉。opencv.py的91行代码中插入几行,可能不是很合理。
# opencv.py 中find_camera()中 is_open == camera.isOpened()下面
if is_open and camera.get(cv2.CAP_PROP_FPS) == int(17):camera.release()print("not use IR camera!!!")continue
2)同时插入两个相机usb,一个正常,一个画面卡,拓展坞有点垃圾问题,换成其它的接口正常显示多个图像。
4、测试遥操作问题
测试遥操作时没问题,但同时显示图像时出现async_read() Time out!。
增加fps* 6等到的数量,并且有时候需要多次执行,有时候出问题,有时候正常,奇怪了。问题是多线程启动多相机问题。难道还有硬件的问题。知道大佬评论区交流下。