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 static std::string GetDefaultName();
74 std::string getDefaultName() const override;
75
76 //ice interface
77 void startRecordingNextViewPoint(const Ice::Current& = Ice::emptyCurrent) override;
78 void stopRecordingViewPoint(const Ice::Current& = Ice::emptyCurrent) override;
79 void clearViewPoints(const Ice::Current& = Ice::emptyCurrent) override;
81 const Ice::Current& = Ice::emptyCurrent) override;
82 void setDownsamplingGridSize(Ice::Float s,
83 const Ice::Current& = Ice::emptyCurrent) override;
84 void setFrameRate(Ice::Float r, const Ice::Current& = Ice::emptyCurrent) override;
85
86 protected:
87 RemoteGui::WidgetPtr buildGui();
89
90 void process() override;
91 template <class PointType>
92 void process();
93 template <class PointType>
94 void doProvide();
95
96 void onInitPointCloudProcessor() override;
97 void onConnectPointCloudProcessor() override;
98
99 void
101 {
102 }
103
104 void onExitPointCloudProcessor() override;
105
106 /// @see PropertyUser::createPropertyDefinitions()
108
109 private:
110 //provider data
111 std::string _pointCloudProviderName;
112 visionx::PointCloudProviderInfo _pointCloudProviderInfo;
113 visionx::PointCloudProviderInterfacePrx _pointCloudProvider;
114 std::string _pointCloudProviderRefFrame;
115
116 mutable std::recursive_mutex _cfgBufWriteMutex;
117 mutable std::recursive_mutex _cfgBufReadMutex;
119
120
122
123 struct ViewPoint
124 {
125 std::deque<std::any> clouds;
126 };
127
128 mutable std::recursive_mutex _viewPointsMutex;
129 std::deque<ViewPoint> _viewPoints;
130 std::atomic_int _currentViewpoint = -1;
131 std::atomic_bool _doRecord = false;
132 std::atomic_bool _doClear = false;
133
134 std::thread _providerThread;
135 std::atomic_bool _stopProviding = false;
136 };
137} // 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
std::string getDefaultName() const override
Retrieve default name of component.
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.