36 defineOptionalProperty<std::string>(
37 "ResultPointCloudName",
"UserAssistedSegmenterResult",
38 "Name of the output segmented point cloud.");
43 defineOptionalProperty<std::string>(
44 "UserAssistedSegmenterTopicName",
"UserAssistedSegmenterUpdates",
45 "Topic where received point clouds are reported.");
50 defineOptionalProperty<float>(
51 "PublishFrequency", 1.0f,
"Rate [1/s] the result point cloud will be published at."
52 "If zero, the point cloud will be published exactly once.");
58 return "UserAssistedSegmenter";
64 resultPointCloudName = getProperty<std::string>(
"ResultPointCloudName");
66 offeringTopic(getProperty<std::string>(
"UserAssistedSegmenterTopicName"));
69 publishFrequency = getProperty<float>(
"PublishFrequency");
74 enableResultPointClouds<PointL>(resultPointCloudName);
76 updatesListener = getTopic<visionx::UserAssistedSegmenterListenerPrx>(
77 getProperty<std::string>(
"UserAssistedSegmenterTopicName"));
79 if (publishFrequency > 0)
83 static_cast<int>(std::round(1000.f / publishFrequency)));
107 PointCloudL::Ptr pointCloudPtr(
new PointCloudL());
114 ARMARX_VERBOSE <<
"Received point cloud with " << pointCloudPtr->size() <<
" points.";
116 const visionx::ColoredLabeledPointCloud visionxPointCloud =
117 visionx::tools::convertFromPCL<visionx::ColoredLabeledPoint3D>(*pointCloudPtr);
118 updatesListener->reportSegmentation(visionxPointCloud);
123 const visionx::ColoredLabeledPointCloud& pointCloud,
const Ice::Current&)
127 resultPointCloud.reset(
new PointCloudL());
134 else if (!provideTask->isRunning())
136 provideTask->start();
142 if (resultPointCloud)