LeRobot 旨在为现实世界的机器人技术提供基于 PyTorch 的模型、数据集和工具。目标是降低入门门槛,让每个人都能从共享数据集和预训练模型中受益并为其做出贡献。
🤗 硬件无关的 Python 原生接口:标准化了从低成本机械臂 (SO-100) 到人形机器人等多样化平台的控制。
🤗 标准化、可扩展的 LeRobotDataset 格式 (Parquet + MP4 或图像),托管在 Hugging Face Hub 上,支持海量机器人数据集的存储、流式传输和可视化。
🤗 经过验证可迁移到现实世界的先进策略,支持训练和部署。
🤗 对开源生态系统的全面支持,旨在普及物理人工智能。
LeRobot 可以直接从 PyPI 安装。
pip install lerobot
lerobot-info
[!IMPORTANT]
详细的安装指南,请参阅 安装文档。
LeRobot 提供了一个统一的 Robot 类接口,将控制逻辑与硬件细节解耦。它支持广泛的机器人和遥操作设备。
from lerobot.robots.myrobot import MyRobot
# 连接到机器人
robot = MyRobot(config=...)
robot.connect()
# 读取观测并发送动作
obs = robot.get_observation()
action = model.select_action(obs)
robot.send_action(action)
支持的硬件:SO100, LeKiwi, Koch, HopeJR, OMX, EarthRover, Reachy2, 游戏手柄, 键盘, 手机, OpenARM, Unitree G1。
虽然这些设备已原生集成到 LeRobot 代码库中,但该库被设计为可扩展的。您可以轻松实现 Robot 接口,以便将 LeRobot 的数据收集、训练和可视化工具用于您自己的自定义机器人。
详细的硬件设置指南,请参阅 硬件文档。
为了解决机器人领域的数据碎片化问题,我们采用了 LeRobotDataset 格式。
from lerobot.datasets.lerobot_dataset import LeRobotDataset
# 从 Hub 加载数据集
dataset = LeRobotDataset("lerobot/aloha_mobile_cabinet")
# 访问数据(自动处理视频解码)
episode_index=0
print(f"{dataset[episode_index]['action'].shape=}\n")
了解更多信息,请参阅 LeRobotDataset 文档
LeRobot 以纯 PyTorch 实现了先进的策略,涵盖模仿学习、强化学习和视觉-语言-动作模型,更多模型即将推出。它还提供了工具来监控和检查您的训练过程。
训练一个策略就像运行一个脚本配置一样简单:
lerobot-train \
--policy=act \
--dataset.repo_id=lerobot/aloha_mobile_cabinet
| 类别 | 模型 |
|---|---|
| 模仿学习 | ACT, Diffusion, VQ-BeT |
| 强化学习 | HIL-SERL, TDMPC & QC-FQL (即将推出) |
| VLA 模型 | Pi0Fast, Pi0.5, GR00T N1.5, SmolVLA, XVLA |
与硬件类似,您可以轻松实现自己的策略,并利用 LeRobot 的数据收集、训练和可视化工具,并将您的模型分享到 HF Hub。
详细的策略设置指南,请参阅 策略文档。
使用统一的评估脚本在仿真或真实硬件上评估您的策略。LeRobot 支持标准基准测试,如 LIBERO、MetaWorld 等(更多即将推出)。
# 在 LIBERO 基准上评估策略
lerobot-eval \
--policy.path=lerobot/pi0_libero_finetuned \
--env.type=libero \
--env.task=libero_object \
--eval.n_episodes=10
了解如何实现您自己的仿真环境或基准测试,并通过 HF Hub 分发,请遵循 EnvHub 文档
LeRobot 服务器与社区讨论。如果您在项目中使用 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 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 出版物:
@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 指南。无论您是添加新功能、改进文档还是修复错误,您的帮助和反馈都是无价的。我们对开源机器人技术的未来感到无比兴奋,并迫不及待地想与您一起探索接下来的发展——感谢您的支持!