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
33namespace visionx
34{
35
40 {
41 public:
43 std::string getDefaultName() const override;
44 static std::string GetDefaultName();
45
46 MetaPointCloudFormatPtr getDefaultPointCloudFormat() override;
47
48 protected:
50
51 void onInitPointCloudProvider() override;
52 void onConnectPointCloudProvider() override;
53 void onExitPointCloudProvider() override;
54
55
56 private:
57 template <class PointT>
58 void registerToUpdates();
59
60 template <class PointT, class AronT>
61 void queryAndProvide();
62
63 void processUpdates(const armarx::armem::MemoryID& entityID,
64 const std::vector<armarx::armem::MemoryID>& updatedSnapshotIDs);
65
66 void runPolling();
67
68 private:
69 struct Properties
70 {
71 std::string memoryName = "Vision";
72 std::string coreSegmentName = "(auto)";
73 std::string providerSegmentName = "ProviderSegmentName";
74 std::string entityName = visionx::armem::pointcloud::ENTITY_NAME;
76 std::string elementPath = "pointcloud";
77 std::string elementPathDelimiter = armarx::aron::Path::DEFAULT_DELIMETER;
78 std::string robotName = "Armar6";
79
80 std::string frame = "AzureKinectCamera";
81
82 unsigned int width = 400000;
83 unsigned int height = 1;
84
85 template <class PointT>
86 std::string getCoreSegmentName() const;
87
88 bool convertToGlobalFrame = true;
89 };
90
91 Properties p;
92
93 // misc
94 std::atomic_bool processing = false;
95
96 // memory stuff
98
99 template <typename T>
101
102
103 ReaderWriterPlugin<armarx::armem::robot_state::VirtualRobotReader>*
104 virtualRobotReaderPlugin = nullptr;
105
107 };
108} // namespace visionx
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
Reads data from a memory server.
Definition Reader.h:25
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
static const constexpr char * DEFAULT_DELIMETER
Definition Path.h:39
void onConnectPointCloudProvider() override
This is called when the Component::onConnectComponent() setup is called.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onInitPointCloudProvider() override
This is called when the Component::onInitComponent() is called.
MetaPointCloudFormatPtr getDefaultPointCloudFormat() override
default point cloud format used to initialize shared memory
void onExitPointCloudProvider() override
This is called when the Component::onExitComponent() setup is called.
std::string getDefaultName() const override
Retrieve default name of component.
PointCloudProvider abstract class defines a component which provide point clouds via ice or shared me...
client::plugins::ListeningPluginUser ListeningClientPluginUser
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
const constexpr char * POINT_XYZRGBA_SLUG
Definition constants.h:88
const constexpr char * ENTITY_NAME
Definition constants.h:19
ArmarX headers.