YARP
Yet Another Robot Platform
IRGBDSensor.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_DEV_IRGBDSENSOR_H
7 #define YARP_DEV_IRGBDSENSOR_H
8 
9 #include <yarp/os/Stamp.h>
10 #include <yarp/os/Property.h>
11 #include <yarp/sig/Image.h>
12 #include <yarp/sig/Matrix.h>
13 #include <yarp/dev/api.h>
16 
17 
18 namespace yarp {
19 namespace dev {
20 
38  public IRgbVisualParams,
39  public IDepthVisualParams
40 {
41 public:
42 
43  // We should distinguish between rgb and depth sensors, which one is working
44  // and which one isn't. Maybe a specific function with two separated values is better.
45  // Here values are referred to the sensor as a whole.
47  {
48  RGBD_SENSOR_NOT_READY = 0,
49  RGBD_SENSOR_OK_STANBY = 1,
50  RGBD_SENSOR_OK_IN_USE = 2,
51  RGB_SENSOR_ERROR = 3,
52  DEPTH_SENSOR_ERROR = 4,
53  RGBD_SENSOR_GENERIC_ERROR = 5,
54  RGBD_SENSOR_TIMEOUT = 6
55  };
56 
57  virtual ~IRGBDSensor();
58 
59  /*
60  * IRgbVisualParams interface. Look at IVisualParams.h for documentation
61  */
62  int getRgbHeight() override = 0;
63  int getRgbWidth() override = 0;
64  bool getRgbSupportedConfigurations(yarp::sig::VectorOf<CameraConfig> &configurations) override { return false;};
65  bool getRgbResolution(int &width, int &height) override { return false;};
66  bool setRgbResolution(int width, int height) override = 0;
67  bool getRgbFOV(double &horizontalFov, double &verticalFov) override = 0;
68  bool setRgbFOV(double horizontalFov, double verticalFov) override = 0;
69  bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override = 0;
70 
71  /*
72  * IDepthVisualParams interface. Look at IVisualParams.h for documentation
73  */
74  int getDepthHeight() override = 0;
75  int getDepthWidth() override = 0;
76  bool setDepthResolution(int width, int height) override = 0;
77  bool getDepthFOV(double &horizontalFov, double &verticalFov) override = 0;
78  bool setDepthFOV(double horizontalFov, double verticalFov) override = 0;
79  double getDepthAccuracy() override = 0;
80  bool setDepthAccuracy(double accuracy) override = 0;
81  bool getDepthClipPlanes(double &nearPlane, double &farPlane) override = 0;
82  bool setDepthClipPlanes(double nearPlane, double farPlane) override = 0;
83  bool getDepthIntrinsicParam(yarp::os::Property &intrinsic) override = 0;
84 
85  /*
86  * IRGBDSensor specific interface methods
87  */
88 
95  virtual bool getExtrinsicParam(yarp::sig::Matrix &extrinsic) = 0;
96 
102  virtual std::string getLastErrorMsg(yarp::os::Stamp *timeStamp = nullptr) = 0;
103 
116  virtual bool getRgbImage(yarp::sig::FlexImage &rgbImage, yarp::os::Stamp *timeStamp = nullptr) = 0;
117 
126 
138  virtual bool getImages(yarp::sig::FlexImage &colorFrame, yarp::sig::ImageOf<yarp::sig::PixelFloat> &depthFrame, yarp::os::Stamp *colorStamp=nullptr, yarp::os::Stamp *depthStamp=nullptr) = 0;
139 
147 };
148 
149 } // namespace dev
150 } // namespace yarp
151 
152 #endif // YARP_DEV_IRGBDSENSOR_H
contains the definition of a Matrix type
An interface for retrieving intrinsic parameter from a depth camera.
A generic interface for cameras that have both color camera as well as depth camera sensor,...
Definition: IRGBDSensor.h:40
virtual std::string getLastErrorMsg(yarp::os::Stamp *timeStamp=nullptr)=0
Return an error message in case of error.
bool setRgbResolution(int width, int height) override=0
Set the resolution of the rgb image from the camera.
bool setDepthAccuracy(double accuracy) override=0
Set the minimum detectable variation in distance [meter] when possible.
bool getRgbSupportedConfigurations(yarp::sig::VectorOf< CameraConfig > &configurations) override
Get the possible configurations of the camera.
Definition: IRGBDSensor.h:64
bool setDepthResolution(int width, int height) override=0
Set the resolution of the depth image from the camera.
virtual bool getDepthImage(yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthImage, yarp::os::Stamp *timeStamp=nullptr)=0
Get the depth frame from the device.
int getRgbWidth() override=0
Return the width of each frame.
bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override=0
Get the intrinsic parameters of the rgb camera.
int getDepthWidth() override=0
Return the height of each frame.
bool getDepthClipPlanes(double &nearPlane, double &farPlane) override=0
Get the clipping planes of the sensor.
virtual bool getExtrinsicParam(yarp::sig::Matrix &extrinsic)=0
Get the extrinsic parameters from the device.
int getRgbHeight() override=0
Return the height of each frame.
bool getDepthFOV(double &horizontalFov, double &verticalFov) override=0
Get the field of view (FOV) of the depth camera.
virtual bool getImages(yarp::sig::FlexImage &colorFrame, yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthFrame, yarp::os::Stamp *colorStamp=nullptr, yarp::os::Stamp *depthStamp=nullptr)=0
Get the both the color and depth frame in a single call.
bool setDepthClipPlanes(double nearPlane, double farPlane) override=0
Set the clipping planes of the sensor.
virtual bool getRgbImage(yarp::sig::FlexImage &rgbImage, yarp::os::Stamp *timeStamp=nullptr)=0
Get the rgb frame from the device.
bool getRgbFOV(double &horizontalFov, double &verticalFov) override=0
Get the field of view (FOV) of the rgb camera.
bool setRgbFOV(double horizontalFov, double verticalFov) override=0
Set the field of view (FOV) of the rgb camera.
double getDepthAccuracy() override=0
Get the minimum detectable variation in distance [meter].
virtual RGBDSensor_status getSensorStatus()=0
Get the surrent status of the sensor, using enum type.
int getDepthHeight() override=0
Return the height of each frame.
bool setDepthFOV(double horizontalFov, double verticalFov) override=0
Set the field of view (FOV) of the depth camera.
bool getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
Definition: IRGBDSensor.h:65
bool getDepthIntrinsicParam(yarp::os::Property &intrinsic) override=0
Get the intrinsic parameters of the depth camera.
An interface for retrieving intrinsic parameter from a rgb camera.
A class for storing options and configuration information.
Definition: Property.h:34
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:22
Image class with user control of representation details.
Definition: Image.h:414
A class for a Matrix.
Definition: Matrix.h:43
Provides:
Definition: Vector.h:119
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18