33 const std::string& providerName) :
34 providerName(providerName), component(component)
51 while (!
task->isStopped())
61 std::this_thread::sleep_for(std::chrono::milliseconds(1));
73 template <
typename Po
intT>
77 typename pcl::PointCloud<PointT>::Ptr
pc(
new pcl::PointCloud<PointT>());
84 ARMARX_INFO <<
"Visualizing point cloud from provider '" << providerName <<
"'";
102 new armarx::DebugDrawer24BitColoredPointCloud);
105 visualizations[providerName][visionx::eColoredPoints] = dd_pc_colors;
112 new armarx::DebugDrawer24BitColoredPointCloud);
115 visualizations[providerName][visionx::eLabeledPoints] = dd_pc_labels;
127 case visionx::ePoints:
128 processPointCloud<pcl::PointXYZ>(providerName);
131 case visionx::eColoredPoints:
132 processPointCloud<pcl::PointXYZRGBA>(providerName);
135 case visionx::eLabeledPoints:
136 processPointCloud<pcl::PointXYZL>(providerName);
139 case visionx::eColoredLabeledPoints:
140 processPointCloud<pcl::PointXYZRGBL>(providerName);
144 ARMARX_WARNING <<
"Could not visualize point cloud: Unknown format";
155 PointCloudProviderVisualizationInfoList
158 PointCloudProviderVisualizationInfoList result;
162 PointCloudProviderVisualizationInfo p;
173 PointContentType type,
175 const Ice::Current&
c)
188 <<
"Enabling visualization for " << providerName <<
" with type "
190 <<
", which has not been created yet (no point cloud reported so far?)";
197 PointCloudVisualizationInfo
199 const Ice::Current&
c)
208 offeringTopic(getProperty<std::string>(
"DebugDrawerTopicName").getValue());
211 armarx::Split(getProperty<std::string>(
"PointCloudProviders").getValue(),
",",
true);
219 getProperty<std::string>(
"InitiallyDisabledVisualizations").getValue(),
",",
true);
223 (std::find(initiallyDisabled.begin(), initiallyDisabled.end(), providerName) ==
224 initiallyDisabled.end());
232 getProperty<std::string>(
"DebugDrawerTopicName").getValue());
261 handler.second->stop();
288 std::string oldLayerName, currentLayerName, entityName;
297 oldLayerName =
getName() +
"_" + providerName +
"_" +
301 entityName =
"PointCloud_" +
std::to_string(visualizationIteration % 2);
306 PointContentType visualizationType =
310 getProperty<std::string>(
"DefaultVisualizationType").getValue());
315 visualizationType = visionx::ePoints;
320 ARMARX_INFO <<
"Visualizing " << providerName <<
" as "
328 catch (
const std::exception& e)
331 <<
", but no point cloud arrived yet";
355 case visionx::ePoints:
358 case visionx::eColoredPoints:
361 case visionx::eLabeledPoints:
372 std::transform(text.begin(), text.end(), text.begin(), ::tolower);
375 return visionx::ePoints;
377 else if (text ==
"colors")
379 return visionx::eColoredPoints;
381 else if (text ==
"labels")
383 return visionx::eLabeledPoints;
385 return visionx::ePoints;