运动学相关接口
ArmKinematics
Section titled “ArmKinematics”ArmKinematics 是一个机械臂运动学计算类,提供了一些列机械臂相关的运动学接口。
创建机械臂运动学
Section titled “创建机械臂运动学”该方法是一个静态方法。
-
方法原型:
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]逆解的关节值。
解析解逆运动学其中一个解
Section titled “解析解逆运动学其中一个解”-
方法原型:
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]逆解的关节角度。
设置数值求解精度
Section titled “设置数值求解精度”-
方法原型:
set_numerical_precision(self, precision: float) -> None -
参数说明:
参数名称 说明 precision设置的精度。 -
返回值:
None。
ArmType
Section titled “ArmType”ArmType 类是一个枚举器,用于表示机械臂型号。
| 常量成员 | 值 | 说明 |
|---|---|---|
RM65_B | 0 | 机械臂型号 |
RM65_6FB | 1 | |
RM65_6F | 2 | |
RM75_B | 3 | |
RM75_6FB | 4 | |
RM75_6F | 5 | |
ZM73L_6F | 6 | |
ZM73R_6F | 7 |
TorsoKinematics
Section titled “TorsoKinematics”TorsoKinematics 是一个躯干运动学计算类,提供了一些列躯干相关的运动学接口。
创建躯干运动学
Section titled “创建躯干运动学”该方法是一个静态方法。
-
方法原型:
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]逆解的关节值。
检测是否超出关节限位
Section titled “检测是否超出关节限位”-
方法原型:
check_range(self, arg0: list[float]) -> alphabot.core.AbcErrorCode -
参数说明:
参数名称 说明 arg0给定关节值。 -
返回值:
AbcErrorCode.SUCCESS表示未超出关节限位;其他错误码,请参见 AbcErrorCode。
RobotType
Section titled “RobotType”RobotType 类是一个枚举器,用于表示机器人型号。
| 常量成员 | 值 | 说明 |
|---|---|---|
AlphaBot1s | 1 | 机器人型号 |
AlphaBot2 | 2 | |
AlphaBot1s_HuiKe | 3 |
admittance_control_law
Section titled “admittance_control_law”-
方法原型:
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]下一个时刻的关节角度。