RCPointCloudProvider.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::RCPointCloudProvider
17 * @author Fabian Paus ( paus at kit dot edu )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <memory>
26
29
31
34#include <VisionX/interface/components/RGBDImageProvider.h>
36
37#include <Calibration/Undistortion.h>
38#include <Image/ImageProcessor.h>
39#include <rc_genicam_api/device.h>
40#include <rc_genicam_api/imagelist.h>
41#include <rc_genicam_api/stream.h>
42
43namespace rcg
44{
45
46 using DevicePtr = std::shared_ptr<rcg::Device>;
47 using StreamPtr = std::shared_ptr<rcg::Stream>;
48} // namespace rcg
49
50namespace visionx
51{
52
53
54 /**
55 * @class RCPointCloudProviderPropertyDefinitions
56 * @brief
57 */
63
64 /**
65 * @defgroup Component-RCPointCloudProvider RCPointCloudProvider
66 * @ingroup VisionX-Components
67 * A description of the component RCPointCloudProvider.
68 *
69 * @class RCPointCloudProvider
70 * @ingroup Component-RCPointCloudProvider
71 * @brief Brief description of class RCPointCloudProvider.
72 *
73 * Detailed description of class RCPointCloudProvider.
74 */
76 virtual public RGBDPointCloudProviderInterface,
77 virtual public CapturingPointCloudProvider,
78 virtual public ImageProvider,
79 public RoboceptionUser,
81 {
82 public:
84
85 /// @see armarx::ManagedIceObject::getDefaultName()
86 std::string getDefaultName() const override
87 {
88 return GetDefaultName();
89 }
90
91 static std::string GetDefaultName();
92
93 void onInitComponent() override;
94 void onConnectComponent() override;
95 void onDisconnectComponent() override;
96 void onExitComponent() override;
97
98 protected:
100
101 void onExitCapturingPointCloudProvider() override;
102
103 void onStartCapture(float frameRate) override;
104
105 void onStopCapture() override;
106
107 bool doCapture() override;
108
109 bool
110 hasSharedMemorySupport(const Ice::Current& c = Ice::emptyCurrent) override
111 {
112 return true;
113 }
114
115 visionx::StereoCalibration
116 getStereoCalibration(const Ice::Current& c = Ice::emptyCurrent) override
117 {
118 return stereoCalibration;
119 }
120
121 bool
122 getImagesAreUndistorted(const Ice::Current& c = Ice::emptyCurrent) override
123 {
124 return true;
125 }
126
127 std::string
128 getReferenceFrame(const Ice::Current& c = Ice::emptyCurrent) override
129 {
130 return getProperty<std::string>("ReferenceFrameName").getValue();
131 }
132
133 /// @see PropertyUser::createPropertyDefinitions()
135
136
137 void startCaptureForNumFrames(Ice::Int, const Ice::Current&) override;
138
139 // ImageProvider interface
140 protected:
141 void onInitImageProvider() override;
142 void onExitImageProvider() override;
143
144 private:
145 armarx::RemoteGui::WidgetPtr buildGui();
146 void processGui(armarx::RemoteGui::TabProxy& prx);
147
148 void updateFinalCloudTransform(float sx,
149 float sy,
150 float sz,
151 float rx,
152 float ry,
153 float rz,
154 float tx,
155 float ty,
156 float tz);
157
158 Eigen::Matrix4f getFinalCloudTransform();
159
160 private:
161 double scan3dCoordinateScale = 1.0;
162
163 rcg::ImageList intensityBuffer;
164 rcg::ImageList disparityBuffer;
165
167 };
168} // namespace visionx
constexpr T c
Default component property definition container.
Definition Component.h:70
Property< PropertyType > getProperty(const std::string &name)
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Same as the TripleBuffer, but partial writes of the data structure are ok. The write operation may be...
The CapturingPointCloudProvider provides a callback function to trigger the capturing of point clouds...
ImageProvider abstract class defines a component which provide images via ice or shared memory.
std::string getReferenceFrame(const Ice::Current &c=Ice::emptyCurrent) override
bool hasSharedMemorySupport(const Ice::Current &c=Ice::emptyCurrent) override
bool doCapture() override
Main capturing function.
void onExitCapturingPointCloudProvider() override
This is called when the Component::onExitComponent() setup is called.
void onDisconnectComponent() override
Hook for subclass.
visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
void onStartCapture(float frameRate) override
This is called when the point cloud provider capturing has been started.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onInitCapturingPointCloudProvider() override
This is called when the Component::onInitComponent() is called.
bool getImagesAreUndistorted(const Ice::Current &c=Ice::emptyCurrent) override
void onStopCapture() override
This is called when the point cloud provider capturing has been stopped.
void onInitImageProvider() override
This is called when the Component::onInitComponent() is called.
void onExitImageProvider() override
This is called when the Component::onExitComponent() setup is called.
std::string getDefaultName() const override
void startCaptureForNumFrames(Ice::Int, const Ice::Current &) override
This class contains common implementation for RCImageProvider and RCPointCloudProvider.
visionx::StereoCalibration stereoCalibration
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::shared_ptr< rcg::Stream > StreamPtr
std::shared_ptr< rcg::Device > DevicePtr
ArmarX headers.