36 defineOptionalProperty<std::string>(
"ResultPointCloudName",
37 "UserAssistedSegmenterResult",
38 "Name of the output segmented point cloud.");
43 defineOptionalProperty<std::string>(
"UserAssistedSegmenterTopicName",
44 "UserAssistedSegmenterUpdates",
45 "Topic where received point clouds are reported.");
50 defineOptionalProperty<float>(
"PublishFrequency",
52 "Rate [1/s] the result point cloud will be published at."
53 "If zero, the point cloud will be published exactly once.");
59 return "UserAssistedSegmenter";
65 resultPointCloudName = getProperty<std::string>(
"ResultPointCloudName");
67 offeringTopic(getProperty<std::string>(
"UserAssistedSegmenterTopicName"));
70 publishFrequency = getProperty<float>(
"PublishFrequency");
76 enableResultPointClouds<PointL>(resultPointCloudName);
78 updatesListener = getTopic<visionx::UserAssistedSegmenterListenerPrx>(
79 getProperty<std::string>(
"UserAssistedSegmenterTopicName"));
81 if (publishFrequency > 0)
86 static_cast<int>(std::round(1000.f / publishFrequency)));
113 PointCloudL::Ptr pointCloudPtr(
new PointCloudL());
120 ARMARX_VERBOSE <<
"Received point cloud with " << pointCloudPtr->size() <<
" points.";
122 const visionx::ColoredLabeledPointCloud visionxPointCloud =
123 visionx::tools::convertFromPCL<visionx::ColoredLabeledPoint3D>(*pointCloudPtr);
124 updatesListener->reportSegmentation(visionxPointCloud);
133 resultPointCloud.reset(
new PointCloudL());
140 else if (!provideTask->isRunning())
142 provideTask->start();
149 if (resultPointCloud)