YARP
Yet Another Robot Platform
fakeDepthCameraDriver.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_FAKEDEPTHCAMERADRIVER_H
10 #define YARP_FAKEDEPTHCAMERADRIVER_H
11 
12 #include <string>
13 #include <yarp/dev/DeviceDriver.h>
14 #include <yarp/sig/all.h>
15 #include <yarp/sig/Matrix.h>
16 #include <yarp/os/Stamp.h>
17 #include <yarp/dev/IRGBDSensor.h>
19 #include <yarp/dev/PolyDriver.h>
20 
29 {
30 private:
32  typedef yarp::os::Stamp Stamp;
35 
36 public:
39 
40  // DeviceDriver
41  bool open(yarp::os::Searchable& config) override;
42  bool close() override;
43 
44  // IRGBDSensor
45  int getRgbHeight() override;
46  int getRgbWidth() override;
48  bool getRgbResolution(int& width, int& height) override;
49  bool setRgbResolution(int width, int height) override;
50  bool getRgbFOV(double& horizontalFov, double& verticalFov) override;
51  bool setRgbFOV(double horizontalFov, double verticalFov) override;
52  bool getRgbMirroring(bool& mirror) override;
53  bool setRgbMirroring(bool mirror) override;
54 
55  bool getRgbIntrinsicParam(Property& intrinsic) override;
56  int getDepthHeight() override;
57  int getDepthWidth() override;
58  bool setDepthResolution(int width, int height) override;
59  bool getDepthFOV(double& horizontalFov, double& verticalFov) override;
60  bool setDepthFOV(double horizontalFov, double verticalFov) override;
61  bool getDepthIntrinsicParam(Property& intrinsic) override;
62  double getDepthAccuracy() override;
63  bool setDepthAccuracy(double accuracy) override;
64  bool getDepthClipPlanes(double& nearPlane, double& farPlane) override;
65  bool setDepthClipPlanes(double nearPlane, double farPlane) override;
66  bool getDepthMirroring(bool& mirror) override;
67  bool setDepthMirroring(bool mirror) override;
68 
69 
70  bool getExtrinsicParam(yarp::sig::Matrix& extrinsic) override;
71  bool getRgbImage(FlexImage& rgbImage, Stamp* timeStamp = NULL) override;
72  bool getDepthImage(depthImage& depthImage, Stamp* timeStamp = NULL) override;
73  bool getImages(FlexImage& colorFrame, depthImage& depthFrame, Stamp* colorStamp=NULL, Stamp* depthStamp=NULL) override;
74 
76  std::string getLastErrorMsg(Stamp* timeStamp = NULL) override;
77 
78 private:
79  double rgb_h{480};
80  double rgb_w{640};
81  double dep_h{480};
82  double dep_w{640};
83  double accuracy{0.001};
84  double rgb_Vfov{36};
85  double rgb_Hfov{50};
86  double dep_Vfov{36};
87  double dep_Hfov{50};
88  double dep_near{0.4};
89  double dep_far{6};
90 
92  yarp::dev::PolyDriver testgrabber;
94 };
95 #endif // YARP_FAKEDEPTHCAMERADRIVER_H
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
fakeDepthCameraDriver::getImages
bool getImages(FlexImage &colorFrame, depthImage &depthFrame, Stamp *colorStamp=NULL, Stamp *depthStamp=NULL) override
Definition: fakeDepthCameraDriver.cpp:278
fakeDepthCameraDriver::setDepthResolution
bool setDepthResolution(int width, int height) override
Set the resolution of the depth image from the camera.
Definition: fakeDepthCameraDriver.cpp:113
fakeDepthCameraDriver::getRgbResolution
bool getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
Definition: fakeDepthCameraDriver.cpp:101
fakeDepthCameraDriver::getRgbImage
bool getRgbImage(FlexImage &rgbImage, Stamp *timeStamp=NULL) override
Get the rgb frame from the device.
Definition: fakeDepthCameraDriver.cpp:251
all.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
fakeDepthCameraDriver::getRgbSupportedConfigurations
bool getRgbSupportedConfigurations(yarp::sig::VectorOf< yarp::dev::CameraConfig > &configurations) override
Get the possible configurations of the camera.
Definition: fakeDepthCameraDriver.cpp:95
Matrix.h
contains the definition of a Matrix type
fakeDepthCameraDriver::setDepthClipPlanes
bool setDepthClipPlanes(double nearPlane, double farPlane) override
Set the clipping planes of the sensor.
Definition: fakeDepthCameraDriver.cpp:221
fakeDepthCameraDriver::getRgbIntrinsicParam
bool getRgbIntrinsicParam(Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
Definition: fakeDepthCameraDriver.cpp:156
fakeDepthCameraDriver::setRgbMirroring
bool setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
Definition: fakeDepthCameraDriver.cpp:151
fakeDepthCameraDriver::getDepthImage
bool getDepthImage(depthImage &depthImage, Stamp *timeStamp=NULL) override
Definition: fakeDepthCameraDriver.cpp:261
fakeDepthCameraDriver::~fakeDepthCameraDriver
~fakeDepthCameraDriver()
fakeDepthCameraDriver::getRgbMirroring
bool getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
Definition: fakeDepthCameraDriver.cpp:145
yarp::dev::IRGBDSensor::RGBDSensor_status
RGBDSensor_status
Definition: IRGBDSensor.h:63
fakeDepthCameraDriver
fakeDepthCamera: Documentation to be added
Definition: fakeDepthCameraDriver.h:29
fakeDepthCameraDriver::getDepthHeight
int getDepthHeight() override
Return the height of each frame.
Definition: fakeDepthCameraDriver.cpp:174
yarp::sig::ImageOf< yarp::sig::PixelFloat >
yarp::sig::VectorOf< yarp::dev::CameraConfig >
fakeDepthCameraDriver::getDepthIntrinsicParam
bool getDepthIntrinsicParam(Property &intrinsic) override
Get the intrinsic parameters of the depth camera.
Definition: fakeDepthCameraDriver.cpp:191
yarp::dev::IFrameGrabberImage
Read a YARP-format image from a device.
Definition: FrameGrabberInterfaces.h:241
PolyDriver.h
fakeDepthCameraDriver::setRgbResolution
bool setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
Definition: fakeDepthCameraDriver.cpp:108
yarp::sig::FlexImage
Image class with user control of representation details.
Definition: Image.h:403
Stamp.h
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
fakeDepthCameraDriver::getDepthClipPlanes
bool getDepthClipPlanes(double &nearPlane, double &farPlane) override
Get the clipping planes of the sensor.
Definition: fakeDepthCameraDriver.cpp:214
fakeDepthCameraDriver::open
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: fakeDepthCameraDriver.cpp:43
fakeDepthCameraDriver::setRgbFOV
bool setRgbFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the rgb camera.
Definition: fakeDepthCameraDriver.cpp:118
yarp::dev::IRGBDSensor
A generic interface for cameras that have both color camera as well as depth camera sensor,...
Definition: IRGBDSensor.h:56
fakeDepthCameraDriver::getRgbWidth
int getRgbWidth() override
Return the width of each frame.
Definition: fakeDepthCameraDriver.cpp:90
fakeDepthCameraDriver::getRgbHeight
int getRgbHeight() override
Return the height of each frame.
Definition: fakeDepthCameraDriver.cpp:85
FrameGrabberInterfaces.h
define common interfaces to discover remote camera capabilities
yarp::os::Stamp
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:25
IRGBDSensor.h
fakeDepthCameraDriver::getExtrinsicParam
bool getExtrinsicParam(yarp::sig::Matrix &extrinsic) override
Get the extrinsic parameters from the device.
Definition: fakeDepthCameraDriver.cpp:239
fakeDepthCameraDriver::getLastErrorMsg
std::string getLastErrorMsg(Stamp *timeStamp=NULL) override
Return an error message in case of error.
Definition: fakeDepthCameraDriver.cpp:288
fakeDepthCameraDriver::getDepthWidth
int getDepthWidth() override
Return the height of each frame.
Definition: fakeDepthCameraDriver.cpp:179
fakeDepthCameraDriver::getDepthFOV
bool getDepthFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the depth camera.
Definition: fakeDepthCameraDriver.cpp:184
fakeDepthCameraDriver::getDepthMirroring
bool getDepthMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
Definition: fakeDepthCameraDriver.cpp:228
fakeDepthCameraDriver::getRgbFOV
bool getRgbFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the rgb camera.
Definition: fakeDepthCameraDriver.cpp:138
fakeDepthCameraDriver::fakeDepthCameraDriver
fakeDepthCameraDriver()
Definition: fakeDepthCameraDriver.cpp:28
fakeDepthCameraDriver::close
bool close() override
Close the DeviceDriver.
Definition: fakeDepthCameraDriver.cpp:80
fakeDepthCameraDriver::setDepthAccuracy
bool setDepthAccuracy(double accuracy) override
Set the minimum detectable variation in distance [meter] when possible.
Definition: fakeDepthCameraDriver.cpp:132
fakeDepthCameraDriver::getSensorStatus
RGBDSensor_status getSensorStatus() override
Get the surrent status of the sensor, using enum type.
Definition: fakeDepthCameraDriver.cpp:283
fakeDepthCameraDriver::getDepthAccuracy
double getDepthAccuracy() override
Get the minimum detectable variation in distance [meter].
Definition: fakeDepthCameraDriver.cpp:209
fakeDepthCameraDriver::setDepthFOV
bool setDepthFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the depth camera.
Definition: fakeDepthCameraDriver.cpp:125
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
DeviceDriver.h
fakeDepthCameraDriver::setDepthMirroring
bool setDepthMirroring(bool mirror) override
Set the mirroring setting of the sensor.
Definition: fakeDepthCameraDriver.cpp:234
yarp::sig::Matrix
A class for a Matrix.
Definition: Matrix.h:46