23 return "ArMemToPointCloudProvider";
32 defs->optional(p.memoryName,
"mem.01_MemoryName",
"Name of the memory.");
35 "mem.02_CoreSegmentName",
36 "Name of the core segment. If empty or (auto), this is derived from the point type.");
37 defs->optional(p.providerSegmentName,
38 "mem.03_ProviderSegmentName",
39 "Name of the provider segment(s).");
40 defs->optional(p.entityName,
"mem.04_EntityName",
"Name of the entity.");
42 defs->optional(p.pointtype,
"pc.01_PointType",
"The type of the point cloud.");
43 defs->optional(p.width,
"pc.02_Width",
"Width of the buffer.");
44 defs->optional(p.height,
"pc.03_Height",
"Height of the buffer.");
45 defs->optional(p.elementPath,
47 "Path inside the ARON structure to the point cloud element (delimited by '" +
48 p.elementPathDelimiter +
"').");
49 defs->optional(p.robotName,
"p.robotName",
"Name of the robot.");
52 defs->optional(p.convertToGlobalFrame,
"p.convertToGlobalFrame",
"");
65 registerToUpdates<pcl::PointXYZ>();
68 registerToUpdates<pcl::PointXYZL>();
71 registerToUpdates<pcl::PointXYZRGBA>();
74 registerToUpdates<pcl::PointXYZRGBL>();
96 ArMemToPointCloudProvider::runPolling()
102 ARMARX_INFO <<
"Done processing initial point clouds";
113 ArMemToPointCloudProvider::processUpdates(
115 const std::vector<armarx::armem::MemoryID>& updatedSnapshotIDs)
118 if (not processing.exchange(
true))
126 queryAndProvide<pcl::PointXYZ, arondto::PointCloudXYZ>();
129 queryAndProvide<pcl::PointXYZL, arondto::PointCloudXYZL>();
132 queryAndProvide<pcl::PointXYZRGBA, arondto::PointCloudXYZRGBA>();
135 queryAndProvide<pcl::PointXYZRGBL, arondto::PointCloudXYZRGBL>();
143 MetaPointCloudFormatPtr
147 MetaPointCloudFormatPtr info =
new MetaPointCloudFormat();
152 info->type = PointContentType::ePoints;
153 info->capacity = p.width * p.height *
sizeof(Point3D);
156 info->type = PointContentType::eLabeledPoints;
157 info->capacity = p.width * p.height *
sizeof(LabeledPoint3D);
160 info->type = PointContentType::eColoredPoints;
161 info->capacity = p.width * p.height *
sizeof(ColoredPoint3D);
164 info->type = PointContentType::eColoredLabeledPoints;
165 info->capacity = p.width * p.height *
sizeof(ColoredLabeledPoint3D);
170 info->size = info->capacity;
174 template <
class Po
intT>
176 ArMemToPointCloudProvider::registerToUpdates()
180 const std::vector<armarx::armem::MemoryID>& updatedSnapshotIDs)
181 { this->processUpdates(entityID, updatedSnapshotIDs); };
183 p.memoryName, p.getCoreSegmentName<
PointT>(), p.providerSegmentName, p.entityName);
188 template <
class Po
intT,
class AronT>
190 ArMemToPointCloudProvider::queryAndProvide()
194 p.memoryName, p.getCoreSegmentName<
PointT>(), p.providerSegmentName, p.entityName);
195 std::optional<armarx::armem::wm::EntitySnapshot>
data =
198 if (
data.has_value())
210 aronAdapted->setElement(
"pointcloud", aronPointCloud);
212 AronT arondto = AronT::FromAron(aronAdapted);
214 typename pcl::PointCloud<PointT>::Ptr toProvide(
new pcl::PointCloud<PointT>());
215 *toProvide = arondto.pointcloud;
217 if (p.convertToGlobalFrame)
224 visionx::transformPointCloudFromTo<PointT>(
228 ARMARX_VERBOSE <<
"Providing point cloud with " << toProvide->points.size()
236 template <
class Po
intT>
238 ArMemToPointCloudProvider::Properties::getCoreSegmentName()
const
240 if (coreSegmentName.empty() or coreSegmentName ==
"(auto)")
242 return visionx::armem::pointcloud::GetCoreSegmentNameFor<PointT>();
246 return coreSegmentName;