LeRobot 中的每个机器人都实现了 Robot 接口:连接、读取 observation、发送 action、
断开连接。针对该接口编写 policy 或录制脚本,意味着它无需修改即可适用于任何受支持的
机械臂。
本页是生成的参考文档。关于接线、calibration 和首次运行的说明,请从 硬件指南开始——SO-101、LeKiwi、Hope Jr、Reachy 2、 OpenArm——或查看机器人模仿学习了解端到端工作流程。要添加 你自己的机器人,请参阅接入你自己的硬件。
抽象基类。子类实现下面的每个方法;这里描述的契约是 policy 或录制循环可以依赖的。
( config: RobotConfig )
所有与 LeRobot 兼容的机器人的基础抽象类。
此类提供了用于与物理机器人交互的标准化接口。 子类必须实现所有抽象方法和属性才能使用。
( calibrate: bool = True )
与机器人建立通信。
与机器人断开连接并执行任何必要的清理。
对机器人应用任何一次性或运行时配置。 这可能包括设置电机参数、控制模式或初始 state。
如适用则 calibrate 机器人。否则,这应为空操作。
此方法应收集任何必要的数据(例如电机偏移量),并相应更新
:pyattr:calibration 字典。
( ) → RobotObservation
返回
RobotObservation
表示机器人当前感官 state 的扁平字典。其结构
应与 :pymeth:observation_features 匹配。
从机器人检索当前 observation。
( action: dict ) → RobotAction
向机器人发送 action 命令。
描述机器人所产生 observation 的结构和类型的字典。
其结构(键)应与 :pymeth:get_observation 返回的结构匹配。
该字典的值应为以下之一:
float(height, width, channel)注意:无论机器人是否已连接,都应能调用此属性。
描述机器人所期望 action 的结构和类型的字典。其结构
(键)应与传递给 :pymeth:send_action 的结构匹配。该字典的值
应为:如果值是简单值,则为该值的类型,例如单一本体感受值
(关节的目标位置/速度)用 float
注意:无论机器人是否已连接,都应能调用此属性。
机器人当前是否已连接。如果为 False,调用 :pymeth:get_observation 或
:pymeth:send_action 应抛出错误。
机器人当前是否已 calibration。如不适用,应始终为 True
( id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
SO100Follower 和 SO101Follower 是同一个 SOFollower 类的别名;这两款机械臂的区别在于它们的
配置,而非控制代码。SO100FollowerConfig 和 SO101FollowerConfig 同样是 SOFollowerRobotConfig 的
别名。
通用 SO follower arm 基类,实现了 SO-100/101/10X 的通用功能。
设计为通过每种硬件型号的 config_class 和 name 进行子类化。
我们假设在连接时,机械臂处于静止位置, 并且可以安全地禁用力矩以运行 calibration。
( action: dict ) → RobotAction
返回
RobotAction
发送给电机、可能被裁剪的 action。
抛出异常
RobotDeviceNotConnectedError
RobotDeviceNotConnectedError — 如果机器人未连接。命令机械臂移动到目标关节配置。
relative action 幅度可能会根据配置参数 max_relative_target 进行裁剪。在这种情况下,发送的 action 与原始 action 不同。
因此,此函数始终返回实际发送的 action。
( port: strdisable_torque_on_disconnect: bool = Truemax_relative_target: float | dict[str, float] | None = Nonecameras: dict = <factory>use_degrees: bool = Trueposition_p_coefficient: int = 16position_i_coefficient: int = 0position_d_coefficient: int = 32num_read_retries: int = 2id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
两个 SO follower arm 作为一个双臂机器人驱动。
由 TheRobotStudio 设计的双臂 SO follower arm
( left_arm_config: SOFollowerConfigright_arm_config: SOFollowerConfigcameras: dict = <factory>id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
Bi SO Follower 机器人的配置类。
我们假设在连接时,机械臂处于静止位置, 并且可以安全地禁用力矩以运行 calibration。
( action: dict ) → RobotAction
命令机械臂移动到目标关节配置。
relative action 幅度可能会根据配置参数 max_relative_target 进行裁剪。在这种情况下,发送的 action 与原始 action 不同。
因此,此函数始终返回实际发送的 action。
( port: strdisable_torque_on_disconnect: bool = Truemax_relative_target: float | dict[str, float] | None = Nonecameras: dict = <factory>use_degrees: bool = Falseid: str | None = Nonecalibration_dir: pathlib.Path | None = None )
LeKiwi 在机器人本身上运行。LeKiwiClient 是主机端代理,它通过网络与其通信
并呈现相同的 Robot 接口。
该机器人包含一个三轮全向移动底座和一个远程 follower arm。 leader arm 本地连接(在笔记本电脑上),其关节位置被记录,然后 (在应用安全钳制后)转发给远程 follower arm。 同时,使用键盘 teleoperation 为轮子生成原始速度命令。
( action: dict ) → RobotAction
返回
RobotAction
发送给电机、可能被裁剪的 action。
抛出异常
RobotDeviceNotConnectedError
RobotDeviceNotConnectedError — 如果机器人未连接。命令 LeKiwi 移动到目标关节配置。
relative action 幅度可能会根据配置参数 max_relative_target 进行裁剪。在这种情况下,发送的 action 与原始 action 不同。
因此,此函数始终返回实际发送的 action。
( port: str = '/dev/ttyACM0'disable_torque_on_disconnect: bool = Truemax_relative_target: float | dict[str, float] | None = Nonecameras: dict = <factory>use_degrees: bool = Truenum_read_retries: int = 2id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
与远程移动机器人建立 ZMQ 套接字
清理 ZMQ 通信
从远程机器人捕获 observation:当前 follower arm 位置、 当前轮速(转换为机体坐标系速度:x、y、theta), 以及一帧相机画面。通过 ZMQ 接收,并转换为机体坐标系速度
( action: dict ) → np.ndarray
命令 LeKiwi 移动到目标关节配置。转换为电机空间并通过 ZMQ 发送
( remote_ip: strport_zmq_cmd: int = 5555port_zmq_observations: int = 5556teleop_keys: dict = <factory>cameras: dict = <factory>polling_timeout_ms: int = 15connect_timeout_s: int = 5id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
OpenArms follower arm 机器人,使用 CAN 总线通信控制带 gripper 的 7 自由度机械臂。 该机械臂使用 MIT 控制模式下的 Damiao 电机。
为 OpenArms 机器人运行 calibration 程序。
calibration 程序:
使用适当的设置配置电机。
连接到机器人并可选择进行 calibration。
我们假设在连接时,机械臂处于安全的静止位置, 并且如果需要,可以安全地禁用力矩以运行 calibration。
与机器人断开连接。
从机器人获取当前 observation,包括位置、速度和力矩。
在一次 CAN 刷新周期内读取所有电机 state(位置/速度/力矩), 而不是进行 3 次单独的读取。
( action: dictcustom_kp: dict[str, float] | None = Nonecustom_kd: dict[str, float] | None = None )
向机器人发送 action 命令。
action 幅度可能会根据安全限制被裁剪。
( port: strside: str | None = Nonecan_interface: str = 'socketcan'use_can_fd: bool = Truecan_bitrate: int = 1000000can_data_bitrate: int = 5000000disable_torque_on_disconnect: bool = Trueuse_velocity_and_torque: bool = Falsemax_relative_target: float | dict[str, float] | None = Nonecameras: dict = <factory>motor_config: dict = <factory>position_kp: list = <factory>position_kd: list = <factory>joint_limits: dict = <factory>id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
( config: BiOpenArmFollowerConfig )
双臂 OpenArm follower arm
( id: str | None = 'bi_openarm_follower'calibration_dir: pathlib.Path | None = Noneleft_arm_config: OpenArmFollowerConfigBaseright_arm_config: OpenArmFollowerConfigBasecameras: dict = <factory> )
Bi OpenArm Follower 机器人的配置类。
对于出厂已 calibration 的 OMX 机器人:
( action: dict ) → RobotAction
命令机械臂移动到目标关节配置。
relative action 幅度可能会根据配置参数 max_relative_target 进行裁剪。在这种情况下,发送的 action 与原始 action 不同。
因此,此函数始终返回实际发送的 action。
( port: strdisable_torque_on_disconnect: bool = Truemax_relative_target: float | dict[str, float] | None = Nonecameras: dict = <factory>use_degrees: bool = Falseid: str | None = Nonecalibration_dir: pathlib.Path | None = None )
Reachy 2,由 Pollen Robotics 开发。
( max_relative_target: float | None = Noneip_address: str | None = 'localhost'port: int = 50065disable_torque_on_disconnect: bool = Falseuse_external_commands: bool = Falsewith_mobile_base: bool = Truewith_l_arm: bool = Truewith_r_arm: bool = Truewith_neck: bool = Truewith_antennas: bool = Truewith_left_teleop_camera: bool = Falsewith_right_teleop_camera: bool = Falsewith_torso_camera: bool = Falsecamera_width: int = 640camera_height: int = 480cameras: dict = <factory>id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
( kp: list = <factory>kd: list = <factory>default_positions: list = <factory>control_dt: float = 0.004is_simulation: bool = Truerobot_ip: str = '192.168.123.164'cameras: dict = <factory>gravity_compensation: bool = Falsecontroller: str | None = Noneid: str | None = Nonecalibration_dir: pathlib.Path | None = None )
Hope Jr 人形机器人以两个独立的机器人形式呈现:一个臂和一个手。
我们假设在连接时,机械臂处于静止位置, 并且可以安全地禁用力矩以运行 calibration。
( port: strdisable_torque_on_disconnect: bool = Truemax_relative_target: float | dict[str, float] | None = Nonecameras: dict = <factory>id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
( port: strside: strdisable_torque_on_disconnect: bool = Truecameras: dict = <factory>id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
( config: RebotB601FollowerRobotConfig )
Seeed Studio reBot B601-DM follower arm(6 自由度 + gripper,Damiao CAN 电机)。
电机通信由 motorbridge 软件包通过 CAN 总线处理,
可通过 Damiao 串行桥接器或 SocketCAN 适配器接入。
禁用电机的力矩,以便可以用手移动机械臂(只读调试)。
命令机械臂移动到目标关节配置。
位置以度为单位表示。relative action 幅度可能会
根据 max_relative_target 被裁剪,因此始终返回实际发送的
action。
( port: strcan_adapter: str = 'damiao'dm_serial_baud: int = 921600disable_torque_on_disconnect: bool = Truemax_relative_target: float | dict[str, float] | None = Nonecameras: dict = <factory>motor_can_ids: dict = <factory>pos_vel_velocity: float | list[float] = <factory>control_mode: str = 'mit'mit_kp: float | list[float] = <factory>mit_kd: float | list[float] = <factory>gripper_control_mode: str = 'force_pos'gripper_torque_ratio: float = 0.07gripper_mit_kp: float = 8.0gripper_mit_kd: float = 0.3joint_limits: dict = <factory>id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
reBot B601-DM follower arm 机器人注册的配置。
( config: BiRebotB601FollowerConfig )
双臂 Seeed Studio reBot B601-DM follower arm。
组合两个单臂 RebotB601Follower 实例。每个臂的 observation 和
action 键都带有 left_ / right_ 前缀命名空间。
( left_arm_config: RebotB601FollowerConfigright_arm_config: RebotB601FollowerConfigcameras: dict = <factory>id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
双臂 reBot B601-DM follower arm 机器人的配置类。
( config: EarthRoverMiniPlusConfig )
通过 Frodobots SDK HTTP API 控制的 EarthRover Mini Plus 机器人。
该机器人通过 Frodobots SDK 使用基于云的控制,而非直接的 硬件连接。相机通过 Agora 云经 WebRTC 传输,控制 命令通过 HTTP POST 请求发送。
该机器人支持:
基于 SDK 的机器人无需 calibration。
配置机器人(对基于 SDK 的机器人为空操作)。
( calibrate: bool = True )
通过 Frodobots SDK 连接到机器人。
与机器人断开连接。
停止机器人并关闭与 SDK 的连接。
( ) → RobotObservation
返回
RobotObservation
包含以下内容的 observation:
抛出异常
DeviceNotConnectedError
DeviceNotConnectedError — 如果机器人未连接 从 SDK 获取当前机器人 observation。
相机帧从 SDK 端点 /v2/front 和 /v2/rear 检索。 帧从 base64 解码,并从 BGR 格式转换为 RGB 格式。 机器人遥测从 /data 端点检索。 传感器数组(加速度计、陀螺仪、磁力计、转速)各自包含形式为 [values…, timestamp] 的条目;使用每个数组中最新的读数。
注意: 相机帧从 SDK 端点 /v2/front 和 /v2/rear 检索。 帧从 base64 解码,并从 BGR 格式转换为 RGB 格式。 机器人遥测从 /data 端点检索。 所有 SDK 值都被归一化到适合 dataset 记录的范围内。
( action: dict ) → RobotAction
通过 SDK 向机器人发送 action。
注意: action 通过 POST /control 端点发送到 SDK。 SDK 期望命令在 [-1, 1] 范围内。
( sdk_url: str = 'http://localhost:8000'id: str | None = Nonecalibration_dir: pathlib.Path | None = None )
使用 Frodobots SDK 的 EarthRover Mini Plus 机器人配置。
该机器人通过 Frodobots SDK HTTP API 使用基于云的控制。 相机帧通过 SDK HTTP 端点直接访问。