RCImageProvider.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::RCImageProvider
17  * @author Markus Grotz ( markus dot grotz at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
26 #include <VisionX/interface/components/Calibration.h>
28 #include <RobotAPI/interface/components/RobotHealthInterface.h>
31 
32 #include <Image/ImageProcessor.h>
33 #include <Calibration/Undistortion.h>
34 
35 
36 #include <rc_genicam_api/device.h>
37 #include <rc_genicam_api/stream.h>
38 #include <rc_genicam_api/imagelist.h>
39 #include <memory>
40 
41 
42 namespace rcg
43 {
44 
45  using DevicePtr = std::shared_ptr<rcg::Device>;
46  using StreamPtr = std::shared_ptr<rcg::Stream> ;
47 }
48 
49 namespace armarx
50 {
51 
52 
53  /**
54  * @class RCImageProviderPropertyDefinitions
55  * @brief
56  */
59  {
60  public:
62  };
63 
64  /**
65  * @defgroup Component-RCImageProvider RCImageProvider
66  * @ingroup VisionX-Components
67  * A description of the component RCImageProvider.
68  *
69  * @class RCImageProvider
70  * @ingroup Component-RCImageProvider
71  * @brief Brief description of class RCImageProvider.
72  *
73  * Detailed description of class RCImageProvider.
74  */
76  virtual public visionx::CapturingImageProvider,
77  virtual public visionx::StereoCalibrationCaptureProviderInterface,
79  {
80  public:
81 
83 
84  /**
85  * @see armarx::ManagedIceObject::getDefaultName()
86  */
87  std::string getDefaultName() const override
88  {
89  return "RCImageProvider";
90  }
91 
92  protected:
93  void onInitCapturingImageProvider() override;
94 
95  void onStartCapturingImageProvider() override;
96 
97  void onExitCapturingImageProvider() override;
98 
99  void onStartCapture(float frameRate) override;
100 
101  void onStopCapture() override;
102 
103  bool capture(void** ppImageBuffers) override;
104 
105  visionx::StereoCalibration getStereoCalibration(const Ice::Current& c = Ice::emptyCurrent) override
106  {
107  return stereoCalibration;
108  }
109 
110  bool getImagesAreUndistorted(const Ice::Current& c = Ice::emptyCurrent) override
111  {
112  return true;
113  }
114 
115  std::string getReferenceFrame(const Ice::Current& c = Ice::emptyCurrent) override
116  {
117  return getProperty<std::string>("ReferenceFrameName").getValue();
118  }
119 
120 
121  /// @see PropertyUser::createPropertyDefinitions()
123 
124 
125  private:
126 
127  void updateCameraSettings();
128 
129  private:
130  RobotHealthInterfacePrx robotHealthTopic;
131 
132  float scaleFactor;
133  bool enableDepth = false;
134 
135  double scan3dCoordinateScale = 1.0;
136 
137 
138  rcg::ImageList intensityBuffer;
139  rcg::ImageList disparityBuffer;
140 
141  };
142 }
143 
rcg::StreamPtr
std::shared_ptr< rcg::Stream > StreamPtr
Definition: RCImageProvider.h:46
armarx::RCImageProvider::onExitCapturingImageProvider
void onExitCapturingImageProvider() override
This is called when the Component::onExitComponent() setup is called.
Definition: RCImageProvider.cpp:273
armarx::RCImageProvider::onInitCapturingImageProvider
void onInitCapturingImageProvider() override
This is called when the Component::onInitComponent() is called.
Definition: RCImageProvider.cpp:219
armarx::RCImageProvider::getDefaultName
std::string getDefaultName() const override
Definition: RCImageProvider.h:87
visionx::CapturingImageProvider::frameRate
float frameRate
Required frame rate.
Definition: CapturingImageProvider.h:198
armarx::RCImageProviderPropertyDefinitions::RCImageProviderPropertyDefinitions
RCImageProviderPropertyDefinitions(std::string prefix)
Definition: RCImageProvider.cpp:49
armarx::RCImageProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: RCImageProvider.cpp:73
visionx::RoboceptionUser
This class contains common implementation for RCImageProvider and RCPointCloudProvider.
Definition: RoboceptionUser.h:57
armarx::RCImageProvider
Brief description of class RCImageProvider.
Definition: RCImageProvider.h:75
armarx::RCImageProvider::getStereoCalibration
visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
Definition: RCImageProvider.h:105
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
rcg
Definition: RCImageProvider.h:42
armarx::RCImageProviderPropertyDefinitions
Definition: RCImageProvider.h:57
armarx::RCImageProvider::onStartCapturingImageProvider
void onStartCapturingImageProvider() override
This is called when the Component::onConnectComponent() setup is called.
Definition: RCImageProvider.cpp:267
armarx::RCImageProvider::getImagesAreUndistorted
bool getImagesAreUndistorted(const Ice::Current &c=Ice::emptyCurrent) override
Definition: RCImageProvider.h:110
visionx::CapturingImageProvider::capture
virtual void capture()
Definition: CapturingImageProvider.cpp:106
visionx::CapturingImageProvider
The CapturingImageProvider provides a callback function to trigger the capturing of images with diffe...
Definition: CapturingImageProvider.h:52
visionx::RoboceptionUser::stereoCalibration
visionx::StereoCalibration stereoCalibration
Definition: RoboceptionUser.h:99
rcg::DevicePtr
std::shared_ptr< rcg::Device > DevicePtr
Definition: RCImageProvider.h:45
armarx::RCImageProvider::onStartCapture
void onStartCapture(float frameRate) override
This is called when the image provider capturing has been started.
Definition: RCImageProvider.cpp:278
Component.h
armarx::RCImageProvider::getReferenceFrame
std::string getReferenceFrame(const Ice::Current &c=Ice::emptyCurrent) override
Definition: RCImageProvider.h:115
armarx::RCImageProvider::onStopCapture
void onStopCapture() override
This is called when the image provider capturing has been stopped.
Definition: RCImageProvider.cpp:284
CapturingImageProvider.h
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
RoboceptionUser.h
armarx::RCImageProvider::RCImageProvider
RCImageProvider()
Definition: RCImageProvider.cpp:87
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28