teleoperator

teleoperator 为机器人产生要跟随的 action——leader arm、游戏手柄、键盘、手机。它们都 实现了 Teleoperator 接口,因此针对该接口编写的录制脚本可与任何输入 设备配合工作。

有关设置指南,请参见手机 teleoperationIsaac Teleop;有关录制工作流程, 请参见机器人模仿学习

Teleoperator

class lerobot.teleoperators.Teleoperator

< >

( config: TeleoperatorConfig )

参数

  • config_class (RobotConfig) — 此 teleoperator 预期的配置类。
  • name (str) — 用于标识此 teleoperator 类型的唯一名称。

所有与 LeRobot 兼容的 teleoperator 的基础抽象类。

此类提供了用于与物理 teleoperator 交互的标准化接口。 子类必须实现所有抽象方法和属性才能使用。

connect

< >

( calibrate: bool = True )

参数

  • calibrate (bool) — 如果为 True,则在连接后,如果 teleoperator 未 calibration 或需要 calibrate,则自动对其进行 calibration(这取决于硬件)。

与 teleoperator 建立通信。

disconnect

< >

( )

与 teleoperator 断开连接并执行任何必要的清理。

configure

< >

( )

对 teleoperator 应用任何一次性或运行时配置。 这可能包括设置电机参数、控制模式或初始 state。

calibrate

< >

( )

如适用则 calibration teleoperator。否则,这应为空操作。

此方法应收集任何必要的数据(例如电机偏移量),并相应更新 :pyattr:calibration 字典。

get_action

< >

( ) RobotAction

返回

RobotAction

表示 teleoperator 当前 action 的扁平字典。其 结构应与 :pymeth:observation_features 匹配。

从 teleoperator 检索当前 action。

send_feedback

< >

( feedback: dict ) dict[str, Any]

参数

  • feedback (dict[str, Any]) — 表示期望反馈的字典。其结构应与 :pymeth:feedback_features 匹配。

返回

dict[str, Any]

实际发送给电机、可能被裁剪或修改的 action,例如受 速度安全限制。

向 teleoperator 发送反馈 action 命令。

action_features

< >

( )

描述 teleoperator 所产生 action 的结构和类型的字典。其 结构(键)应与 :pymeth:get_action 返回的结构匹配。该字典的值 应为:如果值是简单值,则为该值的类型,例如单一 本体感受值(关节的目标位置/速度)用 float

注意:无论机器人是否已连接,都应能调用此属性。

feedback_features

< >

( )

描述机器人所期望反馈 action 的结构和类型的字典。其 结构(键)应与传递给 :pymeth:send_feedback 的结构匹配。该字典的值 应为:如果值是简单值,则为该值的类型,例如单一 本体感受值(关节的目标位置/速度)用 float

注意:无论机器人是否已连接,都应能调用此属性。

is_connected

< >

( )

teleoperator 当前是否已连接。如果为 False,调用 :pymeth:get_action 或 :pymeth:send_feedback 应抛出错误。

is_calibrated

< >

( )

teleoperator 当前是否已 calibration。如不适用,应始终为 True

TeleoperatorConfig

class lerobot.teleoperators.TeleoperatorConfig

< >

( id: str | None = Nonecalibration_dir: pathlib.Path | None = None )

make_teleoperator_from_config

lerobot.teleoperators.make_teleoperator_from_config

< >

( config: TeleoperatorConfig )

在 GitHub 上更新