PointCloudToArMem.cpp
Go to the documentation of this file.
1#include "PointCloudToArMem.h"
2
3// PCL
4#include <pcl/filters/filter.h>
5
6// EIGEN
7#include <Eigen/Core>
8
9// Simox
10#include <SimoxUtility/algorithm/string.h>
11
12// Core types
14
16
17// Memory + aron
19
22
23// VisionX PC stuff
25
26using namespace visionx;
27
30{
33
34 // PC stuff
35 def->optional(
36 p.numClouds,
37 "numClouds",
38 "Number of point clouds before exiting. 0 or negative value means 'do not exit'.");
39 def->optional(p.removeNaNs,
40 "removeNaNs",
41 "If enabled, invalid points will be removed from the point cloud.");
42
43 def->optional(p.pointtype, "pc.PointType", "The Type of the point cloud.");
44
45 // Memory stuff
46 def->optional(p.targetMemoryName,
47 "mem.memoryName",
48 "The Memory Name of the Memory that should receive the PCs");
49 return def;
50}
51
52void
58
59void
81
82void
86
87void
91
92void
94{
95 if (not processing.exchange(true))
96 {
97 switch (visionx::armem::pointcloud::String2PointType.at(simox::alg::to_lower(p.pointtype)))
98 {
100 getDataAndSendToMemory<pcl::PointXYZ, arondto::PointCloudXYZ>();
101 break;
103 getDataAndSendToMemory<pcl::PointXYZL, arondto::PointCloudXYZL>();
104 break;
106 getDataAndSendToMemory<pcl::PointXYZRGBA, arondto::PointCloudXYZRGBA>();
107 break;
109 getDataAndSendToMemory<pcl::PointXYZRGBL, arondto::PointCloudXYZRGBL>();
110 break;
111 }
112
113 processing = false;
114 }
115 else
116 {
117 ARMARX_INFO << "Already processing a point cloud...";
118 }
119}
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
void setComponent(ManagedIceObject *component)
Writer getWriter(const MemoryID &memoryID)
Get a writer to the given memory name.
void enableResultPointClouds(std::string resultProviderName="")
Enables visualization.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
Process the vision component.
void onExitPointCloudProcessor() override
Exit the ImapeProcessor component.
void onConnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component is fully i...
void onDisconnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component looses net...
void onInitPointCloudProcessor() override
Setup the vision component.
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::map< std::string, PointType > String2PointType
Definition constants.h:97
ArmarX headers.