YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
18namespace yarp::dev {
19
37 public IRgbVisualParams,
39{
40public:
41
42 // We should distinguish between rgb and depth sensors, which one is working
43 // and which one isn't. Maybe a specific function with two separated values is better.
44 // Here values are referred to the sensor as a whole.
46 {
47 RGBD_SENSOR_NOT_READY = 0,
48 RGBD_SENSOR_OK_STANDBY = 1,
49 RGBD_SENSOR_OK_IN_USE = 2,
50 RGB_SENSOR_ERROR = 3,
51 DEPTH_SENSOR_ERROR = 4,
52 RGBD_SENSOR_GENERIC_ERROR = 5,
53 RGBD_SENSOR_TIMEOUT = 6
54 };
55
56 virtual ~IRGBDSensor();
57
58 /*
59 * IRgbVisualParams interface. Look at IVisualParams.h for documentation
60 */
61 int getRgbHeight() override = 0;
62 int getRgbWidth() override = 0;
63 bool getRgbSupportedConfigurations(yarp::sig::VectorOf<CameraConfig> &configurations) override { return false;};
64 bool getRgbResolution(int &width, int &height) override { return false;};
65 bool setRgbResolution(int width, int height) override = 0;
66 bool getRgbFOV(double &horizontalFov, double &verticalFov) override = 0;
67 bool setRgbFOV(double horizontalFov, double verticalFov) override = 0;
68 bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override = 0;
69
70 /*
71 * IDepthVisualParams interface. Look at IVisualParams.h for documentation
72 */
73 int getDepthHeight() override = 0;
74 int getDepthWidth() override = 0;
75 bool setDepthResolution(int width, int height) override = 0;
76 bool getDepthFOV(double &horizontalFov, double &verticalFov) override = 0;
77 bool setDepthFOV(double horizontalFov, double verticalFov) override = 0;
78 double getDepthAccuracy() override = 0;
79 bool setDepthAccuracy(double accuracy) override = 0;
80 bool getDepthClipPlanes(double &nearPlane, double &farPlane) override = 0;
81 bool setDepthClipPlanes(double nearPlane, double farPlane) override = 0;
82 bool getDepthIntrinsicParam(yarp::os::Property &intrinsic) override = 0;
83
84 /*
85 * IRGBDSensor specific interface methods
86 */
87
94 virtual bool getExtrinsicParam(yarp::sig::Matrix &extrinsic) = 0;
95
101 virtual std::string getLastErrorMsg(yarp::os::Stamp *timeStamp = nullptr) = 0;
102
115 virtual bool getRgbImage(yarp::sig::FlexImage &rgbImage, yarp::os::Stamp *timeStamp = nullptr) = 0;
116
125
137 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;
138
146};
147
148} // namespace yarp::dev
149
150#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:39
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:63
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:64
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:33
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
Image class with user control of representation details.
Definition Image.h:363
Typed image class.
Definition Image.h:605
A class for a Matrix.
Definition Matrix.h:39
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
constexpr char accuracy[]
#define YARP_dev_API
Definition api.h:18