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
15 
16 // Memory + aron
20 
21 // VisionX PC stuff
23 
24 using namespace visionx;
25 
28 {
31 
32  // PC stuff
33  def->optional(
34  p.numClouds,
35  "numClouds",
36  "Number of point clouds before exiting. 0 or negative value means 'do not exit'.");
37  def->optional(p.removeNaNs,
38  "removeNaNs",
39  "If enabled, invalid points will be removed from the point cloud.");
40 
41  def->optional(p.pointtype, "pc.PointType", "The Type of the point cloud.");
42 
43  // Memory stuff
44  def->optional(p.targetMemoryName,
45  "mem.memoryName",
46  "The Memory Name of the Memory that should receive the PCs");
47  return def;
48 }
49 
50 void
52 {
53  // Memory stuff
55 }
56 
57 void
59 {
60  switch (visionx::armem::pointcloud::String2PointType.at(simox::alg::to_lower(p.pointtype)))
61  {
63  enableResultPointClouds<pcl::PointXYZ>();
64  break;
66  enableResultPointClouds<pcl::PointXYZL>();
67  break;
69  enableResultPointClouds<pcl::PointXYZRGBA>();
70  break;
72  enableResultPointClouds<pcl::PointXYZRGBL>();
73  break;
74  }
75 
76  // Memory stuff
77  memoryWriter = memoryNameSystem().getWriter(armarx::armem::MemoryID(p.targetMemoryName, ""));
78 }
79 
80 void
82 {
83 }
84 
85 void
87 {
88 }
89 
90 void
92 {
93  if (not processing.exchange(true))
94  {
95  switch (visionx::armem::pointcloud::String2PointType.at(simox::alg::to_lower(p.pointtype)))
96  {
98  getDataAndSendToMemory<pcl::PointXYZ, arondto::PointCloudXYZ>();
99  break;
101  getDataAndSendToMemory<pcl::PointXYZL, arondto::PointCloudXYZL>();
102  break;
104  getDataAndSendToMemory<pcl::PointXYZRGBA, arondto::PointCloudXYZRGBA>();
105  break;
107  getDataAndSendToMemory<pcl::PointXYZRGBL, arondto::PointCloudXYZRGBL>();
108  break;
109  }
110 
111  processing = false;
112  }
113  else
114  {
115  ARMARX_INFO << "Already processing a point cloud...";
116  }
117 }
PointCloudToArMem.h
visionx::armem::pointcloud::String2PointType
std::map< std::string, PointType > String2PointType
Definition: constants.h:97
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
aron_conversions.h
armarx::armem::client::plugins::PluginUser::memoryNameSystem
MemoryNameSystem & memoryNameSystem()
Definition: PluginUser.cpp:22
Pose.h
trace.h
visionx::PointCloudToArMem::process
void process() override
Process the vision component.
Definition: PointCloudToArMem.cpp:91
visionx::PointCloudToArMem::onConnectPointCloudProcessor
void onConnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component is fully i...
Definition: PointCloudToArMem.cpp:58
armarx::armem::client::MemoryNameSystem::getWriter
Writer getWriter(const MemoryID &memoryID)
Get a writer to the given memory name.
Definition: MemoryNameSystem.cpp:270
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
visionx::PointCloudToArMem::onInitPointCloudProcessor
void onInitPointCloudProcessor() override
Setup the vision component.
Definition: PointCloudToArMem.cpp:51
visionx::PointCloudToArMem::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: PointCloudToArMem.cpp:27
visionx::PointCloudToArMem::onDisconnectPointCloudProcessor
void onDisconnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component looses net...
Definition: PointCloudToArMem.cpp:81
visionx::armem::pointcloud::PointType::PointXYZL
@ PointXYZL
visionx::PointCloudProcessorPropertyDefinitions
Properties of PointCloudProcessor.
Definition: PointCloudProcessor.h:173
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
visionx::armem::pointcloud::PointType::PointXYZ
@ PointXYZ
armarx::armem::client::MemoryNameSystem::setComponent
void setComponent(ManagedIceObject *component)
Definition: MemoryNameSystem.cpp:440
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
IceUtil::Handle< class PropertyDefinitionContainer >
aron_conversions.h
MemoryNameSystem.h
visionx::PointCloudToArMem::onExitPointCloudProcessor
void onExitPointCloudProcessor() override
Exit the ImapeProcessor component.
Definition: PointCloudToArMem.cpp:86
tools.h
visionx::armem::pointcloud::PointType::PointXYZRGBL
@ PointXYZRGBL
visionx::armem::pointcloud::PointType::PointXYZRGBA
@ PointXYZRGBA