35 #include <VisionX/interface/components/MultiViewPointCloudProcessor.h>
40 armarx::cfg::MVPCLProc, Config,
42 float, gridSize, AX_DEFAULT(50), AX_MIN(0), AX_MAX(10
'000),
43 AX_DESCRIPTION("Grid size for approximate voxel grid (0 = disabled)")
45 (float, frameRate, AX_DEFAULT(30), AX_MIN(0), AX_MAX(300)),
46 (int, maxNumberOfFramesPerViewPoint, AX_DEFAULT(100), AX_MIN(1), AX_MAX(1000))
62 class MultiViewPointCloudProcessor :
63 virtual public visionx::MultiViewPointCloudProcessorInterface,
64 virtual public visionx::PointCloudProcessor,
65 virtual public armarx::RobotStateComponentPluginUser,
66 virtual public DebugObserverComponentPluginUser,
67 virtual public RemoteGuiComponentPluginUser
72 std::string getDefaultName() const override;
75 void startRecordingNextViewPoint(const Ice::Current& = Ice::emptyCurrent) override;
76 void stopRecordingViewPoint(const Ice::Current& = Ice::emptyCurrent) override;
77 void clearViewPoints(const Ice::Current& = Ice::emptyCurrent) override;
78 void setMaxNumberOfFramesPerViewPoint(Ice::Int n, const Ice::Current& = Ice::emptyCurrent) override;
79 void setDownsamplingGridSize(Ice::Float s, const Ice::Current& = Ice::emptyCurrent) override;
80 void setFrameRate(Ice::Float r, const Ice::Current& = Ice::emptyCurrent) override;
83 RemoteGui::WidgetPtr buildGui();
84 void processGui(RemoteGui::TabProxy& prx);
86 void process() override;
87 template<class PointType> void process();
88 template<class PointType> void doProvide();
90 void onInitPointCloudProcessor() override;
91 void onConnectPointCloudProcessor() override;
92 void onDisconnectPointCloudProcessor() override {}
93 void onExitPointCloudProcessor() override;
96 armarx::PropertyDefinitionsPtr createPropertyDefinitions() override;
99 std::string _pointCloudProviderName;
100 visionx::PointCloudProviderInfo _pointCloudProviderInfo;
101 visionx::PointCloudProviderInterfacePrx _pointCloudProvider;
102 std::string _pointCloudProviderRefFrame;
104 mutable std::recursive_mutex _cfgBufWriteMutex;
105 mutable std::recursive_mutex _cfgBufReadMutex;
106 WriteBufferedTripleBuffer<cfg::MVPCLProc::Config> _cfgBuf;
109 VirtualRobot::RobotPtr _robot;
112 std::deque<std::any> clouds;
114 mutable std::recursive_mutex _viewPointsMutex;
115 std::deque<ViewPoint> _viewPoints;
116 std::atomic_int _currentViewpoint = -1;
117 std::atomic_bool _doRecord = false;
118 std::atomic_bool _doClear = false;
120 std::thread _providerThread;
121 std::atomic_bool _stopProviding = false;