YARP
Yet Another Robot Platform
yarp::dev::IRGBDSensor Class Referenceabstract

A generic interface for cameras that have both color camera as well as depth camera sensor, like kinect device. More...

#include <yarp/dev/IRGBDSensor.h>

+ Inheritance diagram for yarp::dev::IRGBDSensor:

Detailed Description

A generic interface for cameras that have both color camera as well as depth camera sensor, like kinect device.

This interface uses the existing IRgbVisualParams and IDepthVisualParams interfaces to retrieve the information about the cameras. This device extends the functionality by adding methods for getting extrinsic parameters and to actually retrieve the images. The images can be synchronized on client side by using the PortSynchronizer object. How the synch policy is implemented depends on the client device, custom policy can be used.

Definition at line 54 of file IRGBDSensor.h.

Public Types

enum  RGBDSensor_status {
  RGBD_SENSOR_NOT_READY = 0,
  RGBD_SENSOR_OK_STANBY = 1,
  RGBD_SENSOR_OK_IN_USE = 2,
  RGB_SENSOR_ERROR = 3,
  DEPTH_SENSOR_ERROR = 4,
  RGBD_SENSOR_GENERIC_ERROR = 5,
  RGBD_SENSOR_TIMEOUT = 6
}
 

Public Member Functions

virtual ~IRGBDSensor ()
 
virtual int getRgbHeight () override=0
 
virtual int getRgbWidth () override=0
 
virtual bool getRgbSupportedConfigurations (yarp::sig::VectorOf< CameraConfig > &configurations) override
 
virtual bool getRgbResolution (int &width, int &height) override
 
virtual bool setRgbResolution (int width, int height) override=0
 
virtual bool getRgbFOV (double &horizontalFov, double &verticalFov) override=0
 
virtual bool setRgbFOV (double horizontalFov, double verticalFov) override=0
 
virtual bool getRgbIntrinsicParam (yarp::os::Property &intrinsic) override=0
 
virtual int getDepthHeight () override=0
 
virtual int getDepthWidth () override=0
 
virtual bool setDepthResolution (int width, int height) override=0
 
virtual bool getDepthFOV (double &horizontalFov, double &verticalFov) override=0
 
virtual bool setDepthFOV (double horizontalFov, double verticalFov) override=0
 
virtual double getDepthAccuracy () override=0
 
virtual bool setDepthAccuracy (double accuracy) override=0
 
virtual bool getDepthClipPlanes (double &nearPlane, double &farPlane) override=0
 
virtual bool setDepthClipPlanes (double nearPlane, double farPlane) override=0
 
virtual bool getDepthIntrinsicParam (yarp::os::Property &intrinsic) override=0
 
virtual bool getExtrinsicParam (yarp::sig::Matrix &extrinsic)=0
 Get the extrinsic parameters from the device. More...
 
virtual std::string getLastErrorMsg (yarp::os::Stamp *timeStamp=NULL)=0
 Return an error message in case of error. More...
 
virtual bool getRgbImage (yarp::sig::FlexImage &rgbImage, yarp::os::Stamp *timeStamp=NULL)=0
 Get the rgb frame from the device. More...
 
virtual bool getDepthImage (yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthImage, yarp::os::Stamp *timeStamp=NULL)=0
 Get the depth frame from the device. More...
 
virtual bool getImages (yarp::sig::FlexImage &colorFrame, yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthFrame, yarp::os::Stamp *colorStamp=NULL, yarp::os::Stamp *depthStamp=NULL)=0
 Get the both the color and depth frame in a single call. More...
 
virtual RGBDSensor_status getSensorStatus ()=0
 Get the surrent status of the sensor, using enum type. More...
 

Member Enumeration Documentation

◆ RGBDSensor_status

Enumerator
RGBD_SENSOR_NOT_READY 
RGBD_SENSOR_OK_STANBY 
RGBD_SENSOR_OK_IN_USE 
RGB_SENSOR_ERROR 
DEPTH_SENSOR_ERROR 
RGBD_SENSOR_GENERIC_ERROR 
RGBD_SENSOR_TIMEOUT 

Definition at line 62 of file IRGBDSensor.h.

Constructor & Destructor Documentation

◆ ~IRGBDSensor()

virtual yarp::dev::IRGBDSensor::~IRGBDSensor ( )
inlinevirtual

Definition at line 73 of file IRGBDSensor.h.

Member Function Documentation

◆ getDepthAccuracy()

virtual double yarp::dev::IRGBDSensor::getDepthAccuracy ( )
overridepure virtual

◆ getDepthClipPlanes()

virtual bool yarp::dev::IRGBDSensor::getDepthClipPlanes ( double &  nearPlane,
double &  farPlane 
)
overridepure virtual

◆ getDepthFOV()

virtual bool yarp::dev::IRGBDSensor::getDepthFOV ( double &  horizontalFov,
double &  verticalFov 
)
overridepure virtual

◆ getDepthHeight()

virtual int yarp::dev::IRGBDSensor::getDepthHeight ( )
overridepure virtual

◆ getDepthImage()

virtual bool yarp::dev::IRGBDSensor::getDepthImage ( yarp::sig::ImageOf< yarp::sig::PixelFloat > &  depthImage,
yarp::os::Stamp timeStamp = NULL 
)
pure virtual

Get the depth frame from the device.

The pixel type of the source image will usually be set as a VOCAB_PIXEL_RGB, but the user can call the function with the pixel type of his/her choice. The conversion if possible, will be done automatically on client side. Note: this will consume CPU power because it will not use GPU optimization. Use VOCAB_PIXEL_RGB for best performances.

Parameters
rgbImagethe image to be filled.
timeStamptime in which the image was acquired. Optional, the user must provide memory allocation
Returns
True on success

Implemented in yarp::dev::RGBDSensorClient.

◆ getDepthIntrinsicParam()

virtual bool yarp::dev::IRGBDSensor::getDepthIntrinsicParam ( yarp::os::Property intrinsic)
overridepure virtual

Implemented in yarp::dev::RGBDSensorClient.

◆ getDepthWidth()

virtual int yarp::dev::IRGBDSensor::getDepthWidth ( )
overridepure virtual

◆ getExtrinsicParam()

virtual bool yarp::dev::IRGBDSensor::getExtrinsicParam ( yarp::sig::Matrix extrinsic)
pure virtual

Get the extrinsic parameters from the device.

Parameters
extrinsicreturn a rototranslation matrix describing the position of the depth optical frame with respect to the rgb frame
Returns
true if success

Implemented in yarp::dev::depthCameraDriver, yarp::dev::RGBDSensorClient, yarp::dev::realsense2Driver, and yarp::dev::fakeDepthCameraDriver.

◆ getImages()

virtual bool yarp::dev::IRGBDSensor::getImages ( yarp::sig::FlexImage colorFrame,
yarp::sig::ImageOf< yarp::sig::PixelFloat > &  depthFrame,
yarp::os::Stamp colorStamp = NULL,
yarp::os::Stamp depthStamp = NULL 
)
pure virtual

Get the both the color and depth frame in a single call.

Implementation should assure the best possible synchronization is achieved accordingly to synch policy set by the user. TimeStamps are referred to acquisition time of the corresponding piece of information. If the device is not providing TimeStamps, then 'timeStamp' field should be set to '-1'.

Parameters
colorFramepointer to FlexImage data to hold the color frame from the sensor
depthFramepointer to FlexImage data to hold the depth frame from the sensor
colorStamppointer to memory to hold the Stamp of the color frame
depthStamppointer to memory to hold the Stamp of the depth frame
Returns
true if able to get both data.

Implemented in yarp::dev::RGBDSensorClient.

◆ getLastErrorMsg()

virtual std::string yarp::dev::IRGBDSensor::getLastErrorMsg ( yarp::os::Stamp timeStamp = NULL)
pure virtual

Return an error message in case of error.

For debugging purpose and user notification. Error message will be reset after any successful command

Returns
A string explaining the last error occurred.

Implemented in yarp::dev::RGBDSensorClient.

◆ getRgbFOV()

virtual bool yarp::dev::IRGBDSensor::getRgbFOV ( double &  horizontalFov,
double &  verticalFov 
)
overridepure virtual

◆ getRgbHeight()

virtual int yarp::dev::IRGBDSensor::getRgbHeight ( )
overridepure virtual

◆ getRgbImage()

virtual bool yarp::dev::IRGBDSensor::getRgbImage ( yarp::sig::FlexImage rgbImage,
yarp::os::Stamp timeStamp = NULL 
)
pure virtual

Get the rgb frame from the device.

The pixel type of the source image will usually be set as a VOCAB_PIXEL_RGB, but the user can call the function with the pixel type of his/her choice. The conversion if possible, will be done automatically on client side (TO BO VERIFIED). Note: this will consume CPU power because it will not use GPU optimization. Use VOCAB_PIXEL_RGB for best performances.

Parameters
rgbImagethe image to be filled.
timeStamptime in which the image was acquired. Optional, the user must provide memory allocation
Returns
True on success

Implemented in yarp::dev::RGBDSensorClient.

◆ getRgbIntrinsicParam()

virtual bool yarp::dev::IRGBDSensor::getRgbIntrinsicParam ( yarp::os::Property intrinsic)
overridepure virtual

Implemented in yarp::dev::RGBDSensorClient.

◆ getRgbResolution()

virtual bool yarp::dev::IRGBDSensor::getRgbResolution ( int &  width,
int &  height 
)
inlineoverridevirtual

◆ getRgbSupportedConfigurations()

virtual bool yarp::dev::IRGBDSensor::getRgbSupportedConfigurations ( yarp::sig::VectorOf< CameraConfig > &  configurations)
inlineoverridevirtual

◆ getRgbWidth()

virtual int yarp::dev::IRGBDSensor::getRgbWidth ( )
overridepure virtual

◆ getSensorStatus()

virtual RGBDSensor_status yarp::dev::IRGBDSensor::getSensorStatus ( )
pure virtual

Get the surrent status of the sensor, using enum type.

Returns
an enum representing the status of the robot or an error code if any error is present

Implemented in yarp::dev::depthCameraDriver, yarp::dev::RGBDSensorClient, yarp::dev::realsense2Driver, and yarp::dev::fakeDepthCameraDriver.

◆ setDepthAccuracy()

virtual bool yarp::dev::IRGBDSensor::setDepthAccuracy ( double  accuracy)
overridepure virtual

◆ setDepthClipPlanes()

virtual bool yarp::dev::IRGBDSensor::setDepthClipPlanes ( double  nearPlane,
double  farPlane 
)
overridepure virtual

◆ setDepthFOV()

virtual bool yarp::dev::IRGBDSensor::setDepthFOV ( double  horizontalFov,
double  verticalFov 
)
overridepure virtual

◆ setDepthResolution()

virtual bool yarp::dev::IRGBDSensor::setDepthResolution ( int  width,
int  height 
)
overridepure virtual

◆ setRgbFOV()

virtual bool yarp::dev::IRGBDSensor::setRgbFOV ( double  horizontalFov,
double  verticalFov 
)
overridepure virtual

◆ setRgbResolution()

virtual bool yarp::dev::IRGBDSensor::setRgbResolution ( int  width,
int  height 
)
overridepure virtual

The documentation for this class was generated from the following file: