跳转到内容

运动学相关接口

ArmKinematics 是一个机械臂运动学计算类,提供了一些列机械臂相关的运动学接口。

该方法是一个静态方法。

  • 方法原型:

    create(arg0: ArmType) -> ArmKinematics
  • 参数说明:

    参数名称说明
    arg0机械臂型号,具体参见 ArmType
  • 返回值:

    若创建成功,则返回 ArmKinematics 实例对象;否则返回 None

  • 方法原型:

    forward_kinematics(self, arg0: list[float]) -> tuple[alphabot.core.AbcErrorCode, alphabot.core.Pose]
  • 参数说明:

    参数名称说明
    arg0给定关节值。
  • 返回值:

    包含两个元素的元组。

    元素数据类型说明
    AbcErrorCodeAbcErrorCode.SUCCESS 表示成功;其他错误码,请参见 AbcErrorCode
    Pose正解的位姿,具体参见 Pose
  • 方法原型:

    inverse_kinematics(
    self,
    pose: alphabot.core.Pose,
    ref_joints: list[float],
    mode: int = 0
    ) -> tuple[alphabot.core.AbcErrorCode, list[float]]
  • 参数说明:

    参数名称说明
    pose位姿,具体参见 Pose
    ref_joints参考关节角度。
    mode- 0:数值解,单步模式,适用于当前位姿与目标位姿相差不大的情况,在连续运动的情况下使用。
    - 1:数值解,多步模式,适用于当前位姿与目标位姿相差较大的情况,时间较长。
    - 2:解析解。
  • 返回值:

    包含两个元素的元组。

    元素数据类型说明
    AbcErrorCodeAbcErrorCode.SUCCESS 表示成功;其他错误码,请参见 AbcErrorCode
    list[float]逆解的关节值。
  • 方法原型:

    inverse_kinematics_analytical(
    self,
    pose: alphabot.core.Pose,
    parameter: float,
    select: int
    ) -> tuple[alphabot.core.AbcErrorCode, list[float]]
  • 参数说明:

    参数名称说明
    pose末端位姿,具体参见 Pose
    parameter冗余参数。
    select逆运动学所有解的索引,推荐选 0重要:末端位姿连续运动时,不要在运动时更改,固定选择的解也是连续的)。
  • 返回值:

    包含两个元素的元组。

    元素数据类型说明
    AbcErrorCodeAbcErrorCode.SUCCESS 表示成功;其他错误码,请参见 AbcErrorCode
    list[float]逆解的关节角度。
  • 方法原型:

    set_numerical_precision(self, precision: float) -> None
  • 参数说明:

    参数名称说明
    precision设置的精度。
  • 返回值:

    None

ArmType 类是一个枚举器,用于表示机械臂型号。

常量成员说明
RM65_B0机械臂型号
RM65_6FB1
RM65_6F2
RM75_B3
RM75_6FB4
RM75_6F5
ZM73L_6F6
ZM73R_6F7

TorsoKinematics 是一个躯干运动学计算类,提供了一些列躯干相关的运动学接口。

该方法是一个静态方法。

  • 方法原型:

    create(arg0: alphabot.core.RobotType) -> TorsoKinematics
  • 参数说明:

    参数名称说明
    arg0机器人型号,具体参见 RobotType
  • 返回值:

    若创建成功,则返回 TorsoKinematics 实例对象;否则返回 None

  • 方法原型:

    forward_kinematics(self, arg0: list[float]) -> tuple[alphabot.core.AbcErrorCode, alphabot.core.AbcTorsoPose4D]
  • 参数说明:

    参数名称说明
    arg0给定关节值。
  • 返回值:

    包含两个元素的元组。

    元素数据类型说明
    AbcErrorCodeAbcErrorCode.SUCCESS 表示成功;其他错误码,请参见 AbcErrorCode
    AbcTorsoPose4D正解的位姿,具体参见 AbcTorsoPose4D
  • 方法原型:

    inverse_kinematics(self, pose: alphabot.core.AbcTorsoPose4D) -> tuple[alphabot.core.AbcErrorCode, list[float]]
  • 参数说明:

    参数名称类型说明
    pose输入参数给定位姿,具体参见 AbcTorsoPose4D
  • 返回值:

    包含两个元素的元组。

    元素数据类型说明
    AbcErrorCodeAbcErrorCode.SUCCESS 表示成功;其他错误码,请参见 AbcErrorCode
    list[float]逆解的关节值。
  • 方法原型:

    check_range(self, arg0: list[float]) -> alphabot.core.AbcErrorCode
  • 参数说明:

    参数名称说明
    arg0给定关节值。
  • 返回值:

    AbcErrorCode.SUCCESS 表示未超出关节限位;其他错误码,请参见 AbcErrorCode

RobotType 类是一个枚举器,用于表示机器人型号。

常量成员说明
AlphaBot1s1机器人型号
AlphaBot22
AlphaBot1s_HuiKe3
  • 方法原型:

    admittance_control_law(
    arm: ArmKinematics,
    pose: alphabot.core.Pose,
    p_stiffness: float,
    r_stiffness: float,
    force: typing.Annotated[list[float], pybind11_stubgen.typing_ext.FixedSize(6)],
    t: float,
    q: list[float]
    ) -> tuple[alphabot.core.AbcErrorCode, list[float]]
  • 参数说明:

    参数名称说明
    armArmKinematics 类型对象。
    pose末端位姿,具体参见 Pose
    p_stiffness平移刚度。
    r_stiffness旋转刚度。
    force末端施加的空间六维力顺序:
    [Mx, My, Mz, Fx, Fy, Fz]
    t积分时间(小于等于一次控制循环所用时间)。
    q当前关节角度。
  • 返回值:

    包含两个元素的元组。

    元素数据类型说明
    AbcErrorCodeAbcErrorCode.SUCCESS 表示成功;其他错误码,请参见 AbcErrorCode
    list[float]下一个时刻的关节角度。