PointCloudToArMem.cpp
Go to the documentation of this file.
1#include "PointCloudToArMem.h"
2
4
5// PCL
6#include <pcl/filters/filter.h>
7
8// EIGEN
9#include <Eigen/Core>
10
11// Simox
12#include <SimoxUtility/algorithm/string.h>
13
14// Core types
16
18
19// Memory + aron
21
24
25// VisionX PC stuff
27
28using namespace visionx;
29
32{
35
36 // PC stuff
37 def->optional(
38 p.numClouds,
39 "numClouds",
40 "Number of point clouds before exiting. 0 or negative value means 'do not exit'.");
41 def->optional(p.removeNaNs,
42 "removeNaNs",
43 "If enabled, invalid points will be removed from the point cloud.");
44
45 def->optional(p.pointtype, "pc.PointType", "The Type of the point cloud.");
46
47 // Memory stuff
48 def->optional(p.targetMemoryName,
49 "mem.memoryName",
50 "The Memory Name of the Memory that should receive the PCs");
51 return def;
52}
53
54void
60
61void
83
84void
88
89void
93
94void
96{
97 if (not processing.exchange(true))
98 {
99 switch (visionx::armem::pointcloud::String2PointType.at(simox::alg::to_lower(p.pointtype)))
100 {
102 getDataAndSendToMemory<pcl::PointXYZ, arondto::PointCloudXYZ>();
103 break;
105 getDataAndSendToMemory<pcl::PointXYZL, arondto::PointCloudXYZL>();
106 break;
108 getDataAndSendToMemory<pcl::PointXYZRGBA, arondto::PointCloudXYZRGBA>();
109 break;
111 getDataAndSendToMemory<pcl::PointXYZRGBL, arondto::PointCloudXYZRGBL>();
112 break;
113 }
114
115 processing = false;
116 }
117 else
118 {
119 ARMARX_INFO << "Already processing a point cloud...";
120 }
121}
122
123
124std::string
126{
127 return "PointCloudToArMem";
128}
129
130std::string
132{
133 return GetDefaultName();
134}
135
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
Definition Decoupled.h:29
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...
static std::string GetDefaultName()
void onInitPointCloudProcessor() override
Setup the vision component.
std::string getDefaultName() const override
Retrieve default name of 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.