Skip to main content

Attach

原型

void Attach(unsigned sourceObjId, unsigned targetObjId, bool keepPos);

功能

将源对象安装到目标对象上

参数

  • sourceObjId: 源对象Id(子对象)
  • targetObjId: 目标对象Id(父对象)
  • keepPos: 是否保持源对象当前位置。如果为true,源对象保持在世界坐标系中的当前位置;如果为false,源对 象将移动到目标对象的位置。

返回值

示例

// 把点云模型安装到变位机"IRBP_A250_D1000_H900_1"的第一个装载坐标系上
unsigned pointCloudid = mpl::CreatePointCloud(points);
auto devices = mpl::GetDeviceList();
for (const auto& device : devices) {
if (device.name != "IRBP_A250_D1000_H900_1")
continue;
auto frameList = mpl::GetMountingFrameList(device.id);
if (frameList.size() > 0)
mpl::Attach(pointCloudid, frameList[0].id, false);
return;
}