ArMemToPointCloudProvider.h
Go to the documentation of this file.
1 #pragma once
2 
3 // STD/STL
4 #include <mutex>
5 
6 // PCL
7 #include <pcl/point_types.h>
8 
9 // Base Classes
13 
16 
18 #include <VisionX/components/pointcloud_provider/ArMemToPointCloudProvider/ArMemToPointCloudProviderInterface.h>
19 
20 // Memory stuff
23 
24 #include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZ.aron.generated.h>
25 #include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZL.aron.generated.h>
26 #include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZRGBA.aron.generated.h>
27 #include <VisionX/libraries/armem/vision/pointcloud/core/aron/PointCloudXYZRGBL.aron.generated.h>
28 
29 // pc
32 
33 namespace visionx
34 {
35 
40  {
41  public:
43  std::string getDefaultName() const override;
44 
45  MetaPointCloudFormatPtr getDefaultPointCloudFormat() override;
46 
47  protected:
49 
50  void onInitPointCloudProvider() override;
51  void onConnectPointCloudProvider() override;
52  void onExitPointCloudProvider() override;
53 
54 
55  private:
56  template <class PointT>
57  void registerToUpdates();
58 
59  template <class PointT, class AronT>
60  void queryAndProvide();
61 
62  void processUpdates(const armarx::armem::MemoryID& entityID,
63  const std::vector<armarx::armem::MemoryID>& updatedSnapshotIDs);
64 
65  void runPolling();
66  private:
67  struct Properties
68  {
69  std::string memoryName = "Vision";
70  std::string coreSegmentName = "(auto)";
71  std::string providerSegmentName = "ProviderSegmentName";
72  std::string entityName = visionx::armem::pointcloud::ENTITY_NAME;
73  std::string pointtype = visionx::armem::pointcloud::POINT_XYZRGBA_SLUG;
74  std::string elementPath = "pointcloud";
75  std::string elementPathDelimiter = armarx::aron::Path::DEFAULT_DELIMETER;
76  std::string robotName = "Armar6";
77 
78  std::string frame = "AzureKinectCamera";
79 
80  unsigned int width = 400000;
81  unsigned int height = 1;
82 
83  template <class PointT>
84  std::string getCoreSegmentName() const;
85 
86  bool convertToGlobalFrame = true;
87  };
88 
89  Properties p;
90 
91  // misc
92  std::atomic_bool processing = false;
93 
94  // memory stuff
95  armarx::armem::client::Reader memoryReader;
96 
97  template <typename T>
99 
100 
102  nullptr;
103 
105 
106 
107  };
108 } // namespace visionx
armarx::aron::Path::DEFAULT_DELIMETER
static const constexpr char * DEFAULT_DELIMETER
Definition: Path.h:40
visionx::ArMemToPointCloudProvider::onExitPointCloudProvider
void onExitPointCloudProvider() override
This is called when the Component::onExitComponent() setup is called.
Definition: ArMemToPointCloudProvider.cpp:108
armarx::armem::client::Reader
Reads data from a memory server.
Definition: Reader.h:24
visionx::ArMemToPointCloudProvider
Definition: ArMemToPointCloudProvider.h:36
Reader.h
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
armarx::armem::client::plugins::ReaderWriterPlugin
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
Definition: ReaderWriterPlugin.h:44
PointCloudProvider.h
ReaderWriterPlugin.h
RunningTask.h
constants.h
constants.h
visionx::armem::pointcloud::ENTITY_NAME
const constexpr char * ENTITY_NAME
Definition: constants.h:19
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
visionx::ArMemToPointCloudProviderInterface
Definition: ArMemToPointCloudProviderInterface.ice:31
VirtualRobotReader.h
TaskUtil.h
plugins.h
visionx::ArMemToPointCloudProvider::onInitPointCloudProvider
void onInitPointCloudProvider() override
This is called when the Component::onInitComponent() is called.
Definition: ArMemToPointCloudProvider.cpp:58
Component.h
visionx::ArMemToPointCloudProvider::getDefaultPointCloudFormat
MetaPointCloudFormatPtr getDefaultPointCloudFormat() override
default point cloud format used to initialize shared memory
Definition: ArMemToPointCloudProvider.cpp:144
armarx::armem::laser_scans::constants::memoryName
const std::string memoryName
Definition: constants.h:28
IceUtil::Handle< class PropertyDefinitionContainer >
visionx::ArMemToPointCloudProvider::onConnectPointCloudProvider
void onConnectPointCloudProvider() override
This is called when the Component::onConnectComponent() setup is called.
Definition: ArMemToPointCloudProvider.cpp:80
visionx::ArMemToPointCloudProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ArMemToPointCloudProvider.cpp:27
visionx::ArMemToPointCloudProvider::ArMemToPointCloudProvider
ArMemToPointCloudProvider()
Definition: ArMemToPointCloudProvider.cpp:15
armarx::armem::client::plugins::ListeningPluginUser
A memory name system client which listens to the memory updates topic (MemoryListenerInterface).
Definition: ListeningPluginUser.h:23
visionx::PointCloudProvider
PointCloudProvider abstract class defines a component which provide point clouds via ice or shared me...
Definition: PointCloudProvider.h:58
visionx::ArMemToPointCloudProvider::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: ArMemToPointCloudProvider.cpp:21
visionx::armem::pointcloud::POINT_XYZRGBA_SLUG
const constexpr char * POINT_XYZRGBA_SLUG
Definition: constants.h:88