40 PointCloudProvider::getPointCloud(MetaPointCloudFormatPtr& info,
const Ice::Current&
c)
42 MetaInfoSizeBasePtr infoBase;
43 armarx::Blob result = sharedMemoryProvider->getData(infoBase);
45 info = MetaPointCloudFormatPtr::dynamicCast(infoBase);
49 MetaPointCloudFormatPtr
50 PointCloudProvider::getPointCloudFormat(
const Ice::Current&
c)
54 return sharedMemoryProvider->getMetaInfo();
61 PointCloudProvider::onInitComponent()
68 onInitPointCloudProvider();
70 MetaPointCloudFormatPtr info = getDefaultPointCloudFormat();
71 intermediateBuffer.resize(info->capacity);
73 this, info,
"PointCloudProvider");
76 offeringTopic(getName() +
".PointCloudListener");
80 PointCloudProvider::onConnectComponent()
83 pointCloudProcessorProxy =
84 getTopic<PointCloudProcessorInterfacePrx>(getName() +
".PointCloudListener");
86 if (!sharedMemoryProvider)
89 ARMARX_INFO <<
"Shared memory provider is null: Recreating it";
90 MetaPointCloudFormatPtr info = getDefaultPointCloudFormat();
92 this, info,
"PointCloudProvider");
94 sharedMemoryProvider->start();
96 onConnectPointCloudProvider();
101 PointCloudProvider::onDisconnectComponent()
104 if (sharedMemoryProvider)
106 sharedMemoryProvider->stop();
107 sharedMemoryProvider =
nullptr;
112 PointCloudProvider::onExitComponent()
115 if (sharedMemoryProvider)
117 sharedMemoryProvider->stop();
118 sharedMemoryProvider =
nullptr;
121 onExitPointCloudProvider();
125 PointCloudProvider::updateComponentMetaInfo(
const MetaPointCloudFormatPtr& info)
129 "PointCloudTimestamp",
130 new armarx::Variant(IceUtil::Time::microSeconds(info->timeProvided).toDateTime()));
132 setMetaInfo(
"MaxCycleTimeMS",
new armarx::Variant(fps.getMaxCycleTimeMS()));
133 setMetaInfo(
"MeanCycleTimeMS",
new armarx::Variant(fps.getMeanCycleTimeMS()));
134 setMetaInfo(
"MinCycleTimeMS",
new armarx::Variant(fps.getMinCycleTimeMS()));
138 MetaPointCloudFormatPtr
139 PointCloudProvider::getDefaultPointCloudFormat()
142 MetaPointCloudFormatPtr info =
new MetaPointCloudFormat();
144 info->type = PointContentType::eColoredPoints;
145 info->capacity = 640 * 480 *
sizeof(ColoredPoint3D);
146 info->size = info->capacity;