Python:
电子围栏参数结构体rm_fence_config_t 构造函数
Python
rm_fence_config_t(form=0, name='', cube=None, plane=None, sphere=None)参数初始化:
| 属性 | 类型 | 说明 |
|---|---|---|
form | int, optional | 形状,1:长方体;2:点面矢量平面;3:球体。默认 0;配置平面时填写 2。 |
name | str, optional | 几何模型名称,默认空字符串。新增保存的模型时,按对应接口要求填写不超过 10 个字节的字母、数字或下划线;设置当前围栏参数时无需名称。 |
cube | rm_fence_config_cube_t, optional | 长方体参数,默认 None。 |
plane | rm_fence_config_plane_t, optional | 三点定义的平面参数,坐标单位 m,默认 None。form=2 时使用。 |
sphere | rm_fence_config_sphere_t, optional | 球体参数,默认 None。具体功能对形状的支持范围以对应控制器及接口为准。 |
返回值:
创建 rm_fence_config_t 配置对象。构造对象不会下发配置,也不返回控制器执行状态码。
使用示例:
python
from Robotic_Arm.rm_robot_interface import (
rm_fence_config_t, rm_fence_config_plane_t,
)
# 三个不共线的点,单位 m:
# (0, 0, 0.4)、(0.5, 0, 0.4)、(0, 0.5, 0.4)。
plane_points = rm_fence_config_plane_t(
0.0, 0.0, 0.4,
0.5, 0.0, 0.4,
0.0, 0.5, 0.4,
)
config = rm_fence_config_t(form=2, plane=plane_points)
print(config.to_dict())成员函数
Python
rm_ctypes_wrap.rm_fence_config_t.to_dict(self)
