MultiViewPointCloudProcessor.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package VisionX::ArmarXObjects::MultiViewPointCloudProcessor
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2020
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <any>
26
30
32
34
36#include <VisionX/interface/components/MultiViewPointCloudProcessor.h>
37
38
40 armarx::cfg::MVPCLProc,
41 Config,
42 (float,
43 gridSize,
44 AX_DEFAULT(50),
45 AX_MIN(0),
46 AX_MAX(10'000),
47 AX_DESCRIPTION("Grid size for approximate voxel grid (0 = disabled)")),
48 (float, frameRate, AX_DEFAULT(30), AX_MIN(0), AX_MAX(300)),
49 (int, maxNumberOfFramesPerViewPoint, AX_DEFAULT(100), AX_MIN(1), AX_MAX(1000)));
50
51namespace armarx
52{
53 /**
54 * @defgroup Component-MultiViewPointCloudProcessor MultiViewPointCloudProcessor
55 * @ingroup VisionX-Components
56 * A description of the component MultiViewPointCloudProcessor.
57 *
58 * @class MultiViewPointCloudProcessor
59 * @ingroup Component-MultiViewPointCloudProcessor
60 * @brief Brief description of class MultiViewPointCloudProcessor.
61 *
62 * Detailed description of class MultiViewPointCloudProcessor.
63 */
65 virtual public visionx::MultiViewPointCloudProcessorInterface,
66 virtual public visionx::PointCloudProcessor,
69 virtual public RemoteGuiComponentPluginUser
70 {
71 public:
72 /// @see armarx::ManagedIceObject::getDefaultName()
73 std::string getDefaultName() const override;
74
75 //ice interface
76 void startRecordingNextViewPoint(const Ice::Current& = Ice::emptyCurrent) override;
77 void stopRecordingViewPoint(const Ice::Current& = Ice::emptyCurrent) override;
78 void clearViewPoints(const Ice::Current& = Ice::emptyCurrent) override;
80 const Ice::Current& = Ice::emptyCurrent) override;
81 void setDownsamplingGridSize(Ice::Float s,
82 const Ice::Current& = Ice::emptyCurrent) override;
83 void setFrameRate(Ice::Float r, const Ice::Current& = Ice::emptyCurrent) override;
84
85 protected:
86 RemoteGui::WidgetPtr buildGui();
88
89 void process() override;
90 template <class PointType>
91 void process();
92 template <class PointType>
93 void doProvide();
94
95 void onInitPointCloudProcessor() override;
96 void onConnectPointCloudProcessor() override;
97
98 void
100 {
101 }
102
103 void onExitPointCloudProcessor() override;
104
105 /// @see PropertyUser::createPropertyDefinitions()
107
108 private:
109 //provider data
110 std::string _pointCloudProviderName;
111 visionx::PointCloudProviderInfo _pointCloudProviderInfo;
112 visionx::PointCloudProviderInterfacePrx _pointCloudProvider;
113 std::string _pointCloudProviderRefFrame;
114
115 mutable std::recursive_mutex _cfgBufWriteMutex;
116 mutable std::recursive_mutex _cfgBufReadMutex;
118
119
121
122 struct ViewPoint
123 {
124 std::deque<std::any> clouds;
125 };
126
127 mutable std::recursive_mutex _viewPointsMutex;
128 std::deque<ViewPoint> _viewPoints;
129 std::atomic_int _currentViewpoint = -1;
130 std::atomic_bool _doRecord = false;
131 std::atomic_bool _doClear = false;
132
133 std::thread _providerThread;
134 std::atomic_bool _stopProviding = false;
135 };
136} // namespace armarx
Brief description of class MultiViewPointCloudProcessor.
void stopRecordingViewPoint(const Ice::Current &=Ice::emptyCurrent) override
void clearViewPoints(const Ice::Current &=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
Process the vision component.
void onExitPointCloudProcessor() override
Exit the ImapeProcessor component.
void startRecordingNextViewPoint(const Ice::Current &=Ice::emptyCurrent) override
void onConnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component is fully i...
void onDisconnectPointCloudProcessor() override
Implement this method in the PointCloudProcessor in order execute parts when the component looses net...
void setFrameRate(Ice::Float r, const Ice::Current &=Ice::emptyCurrent) override
void setDownsamplingGridSize(Ice::Float s, const Ice::Current &=Ice::emptyCurrent) override
void onInitPointCloudProcessor() override
Setup the vision component.
void setMaxNumberOfFramesPerViewPoint(Ice::Int n, const Ice::Current &=Ice::emptyCurrent) override
Same as the TripleBuffer, but partial writes of the data structure are ok. The write operation may be...
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
#define ARMARX_CONFIG_STRUCT_DEFINE_ADAPT_CONFIGURE(Namespace, Name,...)
Usage ARMARX_CONFIG_STRUCT_DEFINE_ADAPT_CONFIGURE( foospace, foo, (float, flooat, AX_DEFAULT(1234),...
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.