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 
26 using 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 
52 void
54 {
55  // Memory stuff
57 }
58 
59 void
61 {
63  {
65  enableResultPointClouds<pcl::PointXYZ>();
66  break;
68  enableResultPointClouds<pcl::PointXYZL>();
69  break;
71  enableResultPointClouds<pcl::PointXYZRGBA>();
72  break;
74  enableResultPointClouds<pcl::PointXYZRGBL>();
75  break;
76  }
77 
78  // Memory stuff
79  memoryWriter = memoryNameSystem().getWriter(armarx::armem::MemoryID(p.targetMemoryName, ""));
80 }
81 
82 void
84 {
85 }
86 
87 void
89 {
90 }
91 
92 void
94 {
95  if (not processing.exchange(true))
96  {
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 }
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:20
Pose.h
trace.h
visionx::PointCloudToArMem::process
void process() override
Process the vision component.
Definition: PointCloudToArMem.cpp:93
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:60
httplib::detail::case_ignore::to_lower
unsigned char to_lower(int c)
Definition: httplib.h:346
armarx::armem::client::MemoryNameSystem::getWriter
Writer getWriter(const MemoryID &memoryID)
Get a writer to the given memory name.
Definition: MemoryNameSystem.cpp:413
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
visionx::PointCloudToArMem::onInitPointCloudProcessor
void onInitPointCloudProcessor() override
Setup the vision component.
Definition: PointCloudToArMem.cpp:53
visionx::PointCloudToArMem::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: PointCloudToArMem.cpp:29
visionx::PointCloudToArMem::onDisconnectPointCloudProcessor
void onDisconnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component looses net...
Definition: PointCloudToArMem.cpp:83
visionx::armem::pointcloud::PointType::PointXYZL
@ PointXYZL
visionx::PointCloudProcessorPropertyDefinitions
Properties of PointCloudProcessor.
Definition: PointCloudProcessor.h:166
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
visionx::armem::pointcloud::PointType::PointXYZ
@ PointXYZ
armarx::armem::client::MemoryNameSystem::setComponent
void setComponent(ManagedIceObject *component)
Definition: MemoryNameSystem.cpp:596
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:181
IceUtil::Handle< class PropertyDefinitionContainer >
aron_conversions.h
MemoryNameSystem.h
visionx::PointCloudToArMem::onExitPointCloudProcessor
void onExitPointCloudProcessor() override
Exit the ImapeProcessor component.
Definition: PointCloudToArMem.cpp:88
tools.h
visionx::armem::pointcloud::PointType::PointXYZRGBL
@ PointXYZRGBL
visionx::armem::pointcloud::PointType::PointXYZRGBA
@ PointXYZRGBA