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
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
67 private:
68 struct Properties
69 {
70 std::string memoryName = "Vision";
71 std::string coreSegmentName = "(auto)";
72 std::string providerSegmentName = "ProviderSegmentName";
73 std::string entityName = visionx::armem::pointcloud::ENTITY_NAME;
75 std::string elementPath = "pointcloud";
76 std::string elementPathDelimiter = armarx::aron::Path::DEFAULT_DELIMETER;
77 std::string robotName = "Armar6";
78
79 std::string frame = "AzureKinectCamera";
80
81 unsigned int width = 400000;
82 unsigned int height = 1;
83
84 template <class PointT>
85 std::string getCoreSegmentName() const;
86
87 bool convertToGlobalFrame = true;
88 };
89
90 Properties p;
91
92 // misc
93 std::atomic_bool processing = false;
94
95 // memory stuff
97
98 template <typename T>
100
101
102 ReaderWriterPlugin<armarx::armem::robot_state::VirtualRobotReader>*
103 virtualRobotReaderPlugin = nullptr;
104
106 };
107} // 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.