RoboceptionUser.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::RoboceptionUser
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2019
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <VisionX/interface/components/Calibration.h>
26
27#include <Image/ImageProcessor.h>
28#include <rc_genicam_api/device.h>
29#include <rc_genicam_api/stream.h>
30
31namespace rcg
32{
33 using DevicePtr = std::shared_ptr<rcg::Device>;
34 using StreamPtr = std::shared_ptr<rcg::Stream>;
35 class Image;
36} // namespace rcg
37
39{
40 class CNodeMapRef;
41}
42
43namespace visionx
44{
45 /**
46 * @defgroup Library-RoboceptionUtility RoboceptionUtility
47 * @ingroup Component-RCImageProvider
48 * A description of the library RoboceptionUtility.
49 *
50 * @class RoboceptionUser
51 * @ingroup Library-RoboceptionUtility
52 * @brief This class contains common implementation for
53 * \ref RCImageProvider and \ref RCPointCloudProvider
54 */
56 {
57 //Functions: setup
58 protected:
59 bool initDevice(const std::string& dname);
60
61 void enableIntensity(bool enabled);
62 void enableIntensityCombined(bool enabled);
63 void enableDisparity(bool enabled);
64 void enableConfidence(bool enabled);
65 void enableError(bool enabled);
66
67 void setupStreamAndCalibration(float scalefactor, const std::string& calibSavePath);
68
69 //Functions: runtime
70 protected:
71 void startRC();
72 void stopRC();
73 void cleanupRC();
74
75 void printNodeMap() const;
76
77 static void fillCameraImageRGB(unsigned char* outputPixels,
78 size_t nImage,
79 const uint8_t* inputPixels,
80 size_t width,
81 size_t height,
82 uint64_t pixelFormat,
83 size_t xpadding);
84 static void
85 fillCameraImageRGB(unsigned char* outputPixels, size_t nImage, const rcg::Image& inputRgb);
86 static void fillCameraImageDepth(unsigned char* outputPixels,
87 double f,
88 double t,
89 double scale,
90 const rcg::Image& disparity,
91 size_t upscale = 1);
92
93 //Data
94 protected:
95 //rc
98 std::shared_ptr<GenApi::CNodeMapRef> nodemap;
99 //settings
100 size_t numImages = 0;
101 float scaleFactor = 1;
102 double focalLengthFactor = 1.0;
103 double baseline = 1.0;
104 //VisionX
105 CByteImage** cameraImages{nullptr};
106 CByteImage** smallImages{nullptr};
107 visionx::StereoCalibration stereoCalibration;
108 visionx::ImageDimension dimensions;
109 };
110
111} // namespace visionx
This class contains common implementation for RCImageProvider and RCPointCloudProvider.
void enableDisparity(bool enabled)
visionx::StereoCalibration stereoCalibration
void enableError(bool enabled)
void enableIntensityCombined(bool enabled)
std::shared_ptr< GenApi::CNodeMapRef > nodemap
bool initDevice(const std::string &dname)
void enableConfidence(bool enabled)
void enableIntensity(bool enabled)
void setupStreamAndCalibration(float scalefactor, const std::string &calibSavePath)
visionx::ImageDimension dimensions
static void fillCameraImageDepth(unsigned char *outputPixels, double f, double t, double scale, const rcg::Image &disparity, size_t upscale=1)
static void fillCameraImageRGB(unsigned char *outputPixels, size_t nImage, const uint8_t *inputPixels, size_t width, size_t height, uint64_t pixelFormat, size_t xpadding)
std::shared_ptr< rcg::Stream > StreamPtr
std::shared_ptr< rcg::Device > DevicePtr
ArmarX headers.