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 /**
86 * @see armarx::ManagedIceObject::getDefaultName()
87 */
88 std::string
89 getDefaultName() const override
90 {
91 return "RCPointCloudProvider";
92 }
93
94 void onInitComponent() override;
95 void onConnectComponent() override;
96 void onDisconnectComponent() override;
97 void onExitComponent() override;
98
99 protected:
100 void onInitCapturingPointCloudProvider() override;
101
102 void onExitCapturingPointCloudProvider() override;
103
104 void onStartCapture(float frameRate) override;
105
106 void onStopCapture() override;
107
108 bool doCapture() override;
109
110 bool
111 hasSharedMemorySupport(const Ice::Current& c = Ice::emptyCurrent) override
112 {
113 return true;
114 }
115
116 visionx::StereoCalibration
117 getStereoCalibration(const Ice::Current& c = Ice::emptyCurrent) override
118 {
119 return stereoCalibration;
120 }
121
122 bool
123 getImagesAreUndistorted(const Ice::Current& c = Ice::emptyCurrent) override
124 {
125 return true;
126 }
127
128 std::string
129 getReferenceFrame(const Ice::Current& c = Ice::emptyCurrent) override
130 {
131 return getProperty<std::string>("ReferenceFrameName").getValue();
132 }
133
134 /// @see PropertyUser::createPropertyDefinitions()
136
137
138 void startCaptureForNumFrames(Ice::Int, const Ice::Current&) override;
139
140 // ImageProvider interface
141 protected:
142 void onInitImageProvider() override;
143 void onExitImageProvider() override;
144
145 private:
146 armarx::RemoteGui::WidgetPtr buildGui();
147 void processGui(armarx::RemoteGui::TabProxy& prx);
148
149 void updateFinalCloudTransform(float sx,
150 float sy,
151 float sz,
152 float rx,
153 float ry,
154 float rz,
155 float tx,
156 float ty,
157 float tz);
158
159 Eigen::Matrix4f getFinalCloudTransform();
160
161 private:
162 double scan3dCoordinateScale = 1.0;
163
164 rcg::ImageList intensityBuffer;
165 rcg::ImageList disparityBuffer;
166
168 };
169} // 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.