YARP  2.3.70.2
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:

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 () YARP_OVERRIDE=0
 Return the height of each frame. More...
 
virtual int getRgbWidth () YARP_OVERRIDE=0
 Return the width of each frame. More...
 
virtual bool getRgbSupportedConfigurations (yarp::sig::VectorOf< CameraConfig > &configurations) YARP_OVERRIDE
 Get the possible configurations of the camera. More...
 
virtual bool getRgbResolution (int &width, int &height) YARP_OVERRIDE
 Get the resolution of the rgb image from the camera. More...
 
virtual bool setRgbResolution (int width, int height) YARP_OVERRIDE=0
 Set the resolution of the rgb image from the camera. More...
 
virtual bool getRgbFOV (double &horizontalFov, double &verticalFov) YARP_OVERRIDE=0
 Get the field of view (FOV) of the rgb camera. More...
 
virtual bool setRgbFOV (double horizontalFov, double verticalFov) YARP_OVERRIDE=0
 Set the field of view (FOV) of the rgb camera. More...
 
virtual bool getRgbIntrinsicParam (yarp::os::Property &intrinsic) YARP_OVERRIDE=0
 Get the intrinsic parameters of the rgb camera. More...
 
virtual int getDepthHeight () YARP_OVERRIDE=0
 Return the height of each frame. More...
 
virtual int getDepthWidth () YARP_OVERRIDE=0
 Return the height of each frame. More...
 
virtual bool setDepthResolution (int width, int height) YARP_OVERRIDE=0
 Set the resolution of the depth image from the camera. More...
 
virtual bool getDepthFOV (double &horizontalFov, double &verticalFov) YARP_OVERRIDE=0
 Get the field of view (FOV) of the depth camera. More...
 
virtual bool setDepthFOV (double horizontalFov, double verticalFov) YARP_OVERRIDE=0
 Set the field of view (FOV) of the depth camera. More...
 
virtual double getDepthAccuracy () YARP_OVERRIDE=0
 Get the accuracy of the depth measure in [meter]. More...
 
virtual bool setDepthAccuracy (double accuracy) YARP_OVERRIDE=0
 Set the accuracy of the depth measure in [meter] when possible. More...
 
virtual bool getDepthClipPlanes (double &nearPlane, double &farPlane) YARP_OVERRIDE=0
 Get the clipping planes of the sensor. More...
 
virtual bool setDepthClipPlanes (double nearPlane, double farPlane) YARP_OVERRIDE=0
 Set the clipping planes of the sensor. More...
 
virtual bool getDepthIntrinsicParam (yarp::os::Property &intrinsic) YARP_OVERRIDE=0
 Get the intrinsic parameters of the depth camera. More...
 
virtual bool getExtrinsicParam (yarp::sig::Matrix &extrinsic)=0
 Get the extrinsic parameters ofrom the device. More...
 
virtual yarp::os::ConstString 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...
 
- Public Member Functions inherited from yarp::dev::IRgbVisualParams
virtual ~IRgbVisualParams ()
 
virtual bool getRgbMirroring (bool &mirror)=0
 Get the mirroring setting of the sensor. More...
 
virtual bool setRgbMirroring (bool mirror)=0
 Set the mirroring setting of the sensor. More...
 
- Public Member Functions inherited from yarp::dev::IDepthVisualParams
virtual ~IDepthVisualParams ()
 
virtual bool getDepthMirroring (bool &mirror)=0
 Get the mirroring setting of the sensor. More...
 
virtual bool setDepthMirroring (bool mirror)=0
 Set the mirroring setting of the sensor. More...
 

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 53 of file IRGBDSensor.h.

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 61 of file IRGBDSensor.h.

Constructor & Destructor Documentation

◆ ~IRGBDSensor()

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

Definition at line 72 of file IRGBDSensor.h.

Member Function Documentation

◆ getDepthAccuracy()

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

Get the accuracy of the depth measure in [meter].

Returns
the accuracy of the sensor in meters.

Implements yarp::dev::IDepthVisualParams.

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

◆ getDepthClipPlanes()

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

Get the clipping planes of the sensor.

Parameters
nearPlaneminimum distance at which the sensor start measuring. Object closer than this distance will not be detected.
farPlanemaximum distance beyond which the sensor stop measuring. Object farther than this distance will not be detected.
Returns
true if success

Implements yarp::dev::IDepthVisualParams.

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

◆ getDepthFOV()

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

Get the field of view (FOV) of the depth camera.

Parameters
horizontalFovwill return the value of the horizontal fov in degrees
verticalFovwill return the value of the vertical fov in degrees
Returns
true if success

Implements yarp::dev::IDepthVisualParams.

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

◆ getDepthHeight()

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

Return the height of each frame.

Returns
depth image height

Implements yarp::dev::IDepthVisualParams.

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

◆ 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 choise. The convertion 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)
pure virtual

Get the intrinsic parameters of the depth camera.

Parameters
intrinsicreturn a Property containing intrinsic parameters of the optical model of the camera.
Returns
true if success

The yarp::os::Property describing the intrinsic parameters is expected to be in the form:

Parameter name SubParameter Type Units Default Value Required Description Notes
focalLengthX - double mm - Yes
focalLengthY - double mm - Yes
principalPointX - double pixel - Yes
principalPointY - double pixel - Yes
retificationMatrix - 4x4 double matrix - - Yes
distortionModel - string - - Yes Reference to group of parameters describing the distortion model of the camera, example 'cameraDistortionModelGroup' This is another group's name to be searched for in the config file
cameraDistortionModelGroup
name string - - Yes Name of the distortion model, see notes right now only 'plumb_bob' is supported
k1 double - - Yes Radial distortion coefficient of the lens
k2 double - - Yes Radial distortion coefficient of the lens
k3 double - - Yes Radial distortion coefficient of the lens
t1 double - - Yes Tangential distortion of the lens
t2 double - - Yes Tangential distortion of the lens

Implements yarp::dev::IDepthVisualParams.

Implemented in yarp::dev::RGBDSensorClient.

◆ getDepthWidth()

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

Return the height of each frame.

Returns
depth image height

Implements yarp::dev::IDepthVisualParams.

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

◆ getExtrinsicParam()

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

Get the extrinsic parameters ofrom 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, 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 yarp::os::ConstString 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 succesful 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 
)
pure virtual

Get the field of view (FOV) of the rgb camera.

Parameters
horizontalFovwill return the value of the horizontal fov in degrees
verticalFovwill return the value of the vertical fov in degrees
Returns
true on success

Implements yarp::dev::IRgbVisualParams.

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

◆ getRgbHeight()

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

Return the height of each frame.

Returns
rgb image height

Implements yarp::dev::IRgbVisualParams.

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

◆ 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 choise. The convertion 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)
pure virtual

Get the intrinsic parameters of the rgb camera.

Parameters
intrinsicreturn a Property containing intrinsic parameters of the optical model of the camera.
Returns
true if success

The yarp::os::Property describing the intrinsic parameters is expected to be in the form:

Parameter name SubParameter Type Units Default Value Required Description Notes
focalLengthX - double mm - Yes Horizontal component of the focal lenght
focalLengthY - double mm - Yes Vertical component of the focal lenght
principalPointX - double pixel - Yes X coordinate of the principal point
principalPointY - double pixel - Yes Y coordinate of the principal point
retificationMatrix - 4x4 double matrix - - Yes Matrix that describes the lens' distortion
distortionModel - string - - Yes Reference to group of parameters describing the distortion model of the camera, example 'cameraDistortionModelGroup' This is another group's name to be searched for in the config file
cameraDistortionModelGroup
name string - - Yes Name of the distortion model, see notes right now only 'plumb_bob' is supported
k1 double - - Yes Radial distortion coefficient of the lens
k2 double - - Yes Radial distortion coefficient of the lens
k3 double - - Yes Radial distortion coefficient of the lens
t1 double - - Yes Tangential distortion of the lens
t2 double - - Yes Tangential distortion of the lens

Implements yarp::dev::IRgbVisualParams.

Implemented in yarp::dev::RGBDSensorClient.

◆ getRgbResolution()

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

Get the resolution of the rgb image from the camera.

Parameters
widthimage width
heightimage height
Returns
true on success

Reimplemented from yarp::dev::IRgbVisualParams.

Reimplemented in yarp::dev::depthCameraDriver, yarp::dev::RGBDSensorClient, and yarp::dev::fakeDepthCameraDriver.

Definition at line 80 of file IRGBDSensor.h.

◆ getRgbSupportedConfigurations()

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

Get the possible configurations of the camera.

Parameters
configurationslist of camera supported configurations as CameraConfig type
Returns
true on success

Reimplemented from yarp::dev::IRgbVisualParams.

Reimplemented in yarp::dev::depthCameraDriver, yarp::dev::RGBDSensorClient, and yarp::dev::fakeDepthCameraDriver.

Definition at line 79 of file IRGBDSensor.h.

◆ getRgbWidth()

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

Return the width of each frame.

Returns
rgb image width

Implements yarp::dev::IRgbVisualParams.

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

◆ 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, and yarp::dev::fakeDepthCameraDriver.

◆ setDepthAccuracy()

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

Set the accuracy of the depth measure in [meter] when possible.

Parameters
theaccuracy of the sensor in meters.
Returns
true on success

Implements yarp::dev::IDepthVisualParams.

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

◆ setDepthClipPlanes()

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

Set the clipping planes of the sensor.

Parameters
nearPlaneminimum distance at which the sensor start measuring. Object closer than this distance will not be detected.
farPlanemaximum distance beyond which the sensor stop measuring. Object farther than this distance will not be detected.
Returns
true if success

Implements yarp::dev::IDepthVisualParams.

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

◆ setDepthFOV()

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

Set the field of view (FOV) of the depth camera.

Parameters
horizontalFovwill set the value of the horizontal fov in degrees
verticalFovwill set the value of the vertical fov in degrees
Returns
true on success

Implements yarp::dev::IDepthVisualParams.

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

◆ setDepthResolution()

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

Set the resolution of the depth image from the camera.

Parameters
widthimage width
heightimage height
Returns
true on success

Implements yarp::dev::IDepthVisualParams.

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

◆ setRgbFOV()

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

Set the field of view (FOV) of the rgb camera.

Parameters
horizontalFovwill set the value of the horizontal fov in degrees
verticalFovwill set the value of the vertical fov in degrees
Returns
true on success

Implements yarp::dev::IRgbVisualParams.

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

◆ setRgbResolution()

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

Set the resolution of the rgb image from the camera.

Parameters
widthimage width
heightimage height
Returns
true on success

Implements yarp::dev::IRgbVisualParams.

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


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