12 KiB
Note
本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
English · 原始项目 · 上游 README
原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
LeRobot 旨在为 PyTorch 中的真实世界机器人技术提供模型、数据集和工具。目标是降低入门门槛,让每个人都能为共享数据集和预训练模型做出贡献并从中受益。
🤗 与硬件无关、原生 Python 的接口,可在多样化平台上标准化控制,从低成本机械臂(SO-100)到人形机器人。
🤗 标准化、可扩展的 LeRobotDataset 格式(Parquet + MP4 或图像),托管于 Hugging Face Hub,支持海量机器人数据集的高效存储、流式传输与可视化。
🤗 经过验证可在真实世界中迁移的最先进(state-of-the-art)策略,可直接用于训练与部署。
🤗 全面支持开源生态,推动物理 AI(Physical AI)的普及。
快速入门
LeRobot 可直接从 PyPI 安装。
pip install lerobot
lerobot-info
Important
详细的安装指南请参阅 安装文档.
机器人与控制
LeRobot 提供统一的 Robot 类接口,将控制逻辑与硬件细节解耦。它支持广泛的机器人和遥操作设备。
from lerobot.robots.myrobot import MyRobot
# Connect to a robot
robot = MyRobot(config=...)
robot.connect()
# Read observation and send action
obs = robot.get_observation()
action = model.select_action(obs)
robot.send_action(action)
支持的硬件: SO100、LeKiwi、Koch、HopeJR、OMX、EarthRover、Reachy2、Gamepads、Keyboards、Phones、OpenARM、Unitree G1、reBot B601。
虽然这些设备已原生集成到 LeRobot 代码库中,但该库设计为可扩展。你可以轻松实现 Robot 接口,将 LeRobot 的数据采集、训练与可视化工具用于你自己的定制机器人。
详细的硬件设置指南请参阅 硬件文档.
LeRobot 数据集
为解决机器人领域的数据碎片化问题,我们采用 LeRobotDataset 格式。
- 结构: 为视觉同步的 MP4 视频(或图像),以及用于状态/动作数据的 Parquet 文件。
- HF Hub 集成: 在 Hugging Face Hub. 上探索数千个机器人数据集。
- 工具: 无缝删除 episode、按索引/比例拆分、添加/移除特征,以及合并多个数据集。
from lerobot.datasets.lerobot_dataset import LeRobotDataset
# Load a dataset from the Hub
dataset = LeRobotDataset("lerobot/aloha_mobile_cabinet")
# Access data (automatically handles video decoding)
episode_index=0
print(f"{dataset[episode_index]['action'].shape=}\n")
更多信息请参阅 LeRobotDataset 文档
最先进模型(SoTA Models)
LeRobot 以纯 PyTorch 实现最先进策略,涵盖模仿学习(Imitation Learning)、强化学习(Reinforcement Learning)、视觉-语言-动作(Vision-Language-Action, VLA)模型、世界模型(World Models)和奖励模型(Reward Models),更多即将推出。它还提供用于检测与检查训练过程的工具。
训练策略只需运行脚本配置即可:
lerobot-train \
--policy.type=act \
--dataset.repo_id=lerobot/aloha_mobile_cabinet
| 类别 | 模型 |
|---|---|
| 模仿学习(Imitation Learning) | ACT, Diffusion, VQ-BeT, Multitask DiT Policy |
| 强化学习(Reinforcement Learning) | HIL-SERL, TDMPC & QC-FQL (coming soon) |
| VLA 模型(VLAs Models) | Pi0, Pi0Fast, Pi0.5, GR00T N1.7, SmolVLA, XVLA, EO-1, MolmoAct2, WALL-OSS, EVO1 |
| 世界模型(World Models) | VLA-JEPA, LingBot-VA, FastWAM |
| 奖励模型(Reward Models) | SARM, TOPReward, Robometer |
与硬件类似,你可以轻松实现自己的策略,利用 LeRobot 的数据采集、训练与可视化工具,并将模型分享到 HF Hub。
详细的策略设置指南请参阅 策略文档. 有关各策略的 GPU/RAM 要求与预期训练时间,请参阅 计算硬件指南.
推理与评估
使用统一的评估脚本,在仿真或真实硬件上评估你的策略。LeRobot 支持 LIBERO、MetaWorld 等标准基准测试,并将持续增加更多。
# Evaluate a policy on the LIBERO benchmark
lerobot-eval \
--policy.path=lerobot/pi0_libero_finetuned \
--env.type=libero \
--env.task=libero_object \
--eval.n_episodes=10
了解如何实现你自己的仿真环境或基准测试,并通过 EnvHub 文档 从 HF Hub 分发。
资源
- 文档: 教程与 API 的完整指南。
- 中文教程:LeRobot+SO-ARM101中文教程-同济子豪兄 涵盖组装、遥操作、数据集、训练、部署的详细文档。经 Seed Studio 和 5 位全球黑客松参赛者验证。
- Discord: 加入
LeRobot服务器,与社区交流讨论。 - X: 在 X 上关注我们,获取最新进展。
- 机器人学习教程: 一门免费的实践课程,教你使用 LeRobot 学习机器人学习。
- T 恤折叠实验: 使用 LeRobot 折叠 T 恤的端到端演示。
- LeLab: LeRobot 的 Web 界面——在浏览器中遥操作、校准、录制数据集、回放并训练你的 SO 机械臂,无需 CLI。
引用
如果你在项目中使用 LeRobot,请引用 GitHub 仓库,以致谢持续开发与贡献者:
@misc{cadene2024lerobot,
author = {Cadene, Remi and Alibert, Simon and Soare, Alexander and Gallouedec, Quentin and Zouitine, Adil and Palma, Steven and Kooijmans, Pepijn and Aractingi, Michel and Shukor, Mustafa and Aubakirova, Dana and Russi, Martino and Capuano, Francesco and Pascal, Caroline and Choghari, Jade and Meftah, Khalil and Ellerbach, Maxime and Moss, Jess and Wolf, Thomas},
title = {LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch},
howpublished = "\url{https://github.com/huggingface/lerobot}",
year = {2024}
}
如果你在引用我们的研究或学术论文,也请引用我们的 ICLR 论文:
ICLR 2026 论文
@inproceedings{cadenelerobot,
title={LeRobot: An Open-Source Library for End-to-End Robot Learning},
author={Cadene, Remi and Alibert, Simon and Capuano, Francesco and Aractingi, Michel and Zouitine, Adil and Kooijmans, Pepijn and Choghari, Jade and Russi, Martino and Pascal, Caroline and Palma, Steven and Shukor, Mustafa and Moss, Jess and Soare, Alexander and Aubakirova, Dana and Lhoest, Quentin and Gallou\'edec, Quentin and Wolf, Thomas},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://arxiv.org/abs/2602.22818}
}
贡献
我们欢迎社区中的每一位成员参与贡献!入门请先阅读我们的 CONTRIBUTING.md 指南。无论你是添加新功能、改进文档,还是修复 bug,你的帮助与反馈都弥足珍贵。我们对开源机器人技术的未来充满期待,迫不及待想与你携手共创下一步——感谢你的支持!


