YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

RGBDSensor_nwc_yarp: A Network client to receive data from kinect-like devices. More...

#include <networkWrappers/RGBDSensor_nwc_yarp/RGBDSensor_nwc_yarp.h>

+ Inheritance diagram for RGBDSensor_nwc_yarp:

Public Member Functions

 RGBDSensor_nwc_yarp ()
 
 RGBDSensor_nwc_yarp (const RGBDSensor_nwc_yarp &)=delete
 
 RGBDSensor_nwc_yarp (RGBDSensor_nwc_yarp &&)=delete
 
RGBDSensor_nwc_yarpoperator= (const RGBDSensor_nwc_yarp &)=delete
 
RGBDSensor_nwc_yarpoperator= (RGBDSensor_nwc_yarp &&)=delete
 
 ~RGBDSensor_nwc_yarp () override
 
int getRgbHeight () override
 Return the height of each frame.
 
int getRgbWidth () override
 Return the width of each frame.
 
yarp::dev::ReturnValue getRgbSupportedConfigurations (std::vector< yarp::dev::CameraConfig > &configurations) override
 Get the possible configurations of the camera.
 
yarp::dev::ReturnValue getRgbResolution (int &width, int &height) override
 Get the resolution of the rgb image from the camera.
 
yarp::dev::ReturnValue setRgbResolution (int width, int height) override
 Set the resolution of the rgb image from the camera.
 
yarp::dev::ReturnValue getRgbFOV (double &horizontalFov, double &verticalFov) override
 Get the field of view (FOV) of the rgb camera.
 
yarp::dev::ReturnValue setRgbFOV (double horizontalFov, double verticalFov) override
 Set the field of view (FOV) of the rgb camera.
 
yarp::dev::ReturnValue getRgbIntrinsicParam (yarp::os::Property &intrinsic) override
 Get the intrinsic parameters of the rgb camera.
 
yarp::dev::ReturnValue getRgbMirroring (bool &mirror) override
 Get the mirroring setting of the sensor.
 
yarp::dev::ReturnValue setRgbMirroring (bool mirror) override
 Set the mirroring setting of the sensor.
 
int getDepthHeight () override
 Return the height of each frame.
 
int getDepthWidth () override
 Return the height of each frame.
 
yarp::dev::ReturnValue getDepthResolution (int &width, int &height) override
 Get the resolution of the depth image from the camera.
 
yarp::dev::ReturnValue setDepthResolution (int width, int height) override
 Set the resolution of the depth image from the camera.
 
yarp::dev::ReturnValue getDepthFOV (double &horizontalFov, double &verticalFov) override
 Get the field of view (FOV) of the depth camera.
 
yarp::dev::ReturnValue setDepthFOV (double horizontalFov, double verticalFov) override
 Set the field of view (FOV) of the depth camera.
 
yarp::dev::ReturnValue getDepthAccuracy (double &accuracy) override
 Get the minimum detectable variation in distance [meter].
 
yarp::dev::ReturnValue setDepthAccuracy (double accuracy) override
 Set the minimum detectable variation in distance [meter] when possible.
 
yarp::dev::ReturnValue getDepthClipPlanes (double &near, double &far) override
 Get the clipping planes of the sensor.
 
yarp::dev::ReturnValue setDepthClipPlanes (double near, double far) override
 Set the clipping planes of the sensor.
 
yarp::dev::ReturnValue getDepthIntrinsicParam (yarp::os::Property &intrinsic) override
 Get the intrinsic parameters of the depth camera.
 
yarp::dev::ReturnValue getDepthMirroring (bool &mirror) override
 Get the mirroring setting of the sensor.
 
yarp::dev::ReturnValue setDepthMirroring (bool mirror) override
 Set the mirroring setting of the sensor.
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
yarp::dev::ReturnValue getExtrinsicParam (yarp::sig::Matrix &extrinsic) override
 Get the extrinsic parameters from the device.
 
yarp::dev::ReturnValue getSensorStatus (IRGBDSensor::RGBDSensor_status &status) override
 
yarp::dev::ReturnValue getLastErrorMsg (std::string &message, yarp::os::Stamp *timeStamp=nullptr) override
 Return an error message in case of error.
 
yarp::dev::ReturnValue getRgbImage (yarp::sig::FlexImage &rgbImage, yarp::os::Stamp *timeStamp=nullptr) override
 Get the rgb frame from the device.
 
yarp::dev::ReturnValue getDepthImage (yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthImage, yarp::os::Stamp *timeStamp=nullptr) override
 Get the depth frame from the device.
 
yarp::dev::ReturnValue getImages (yarp::sig::FlexImage &colorFrame, yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthFrame, yarp::os::Stamp *colorStamp=nullptr, yarp::os::Stamp *depthStamp=nullptr) override
 Get the both the color and depth frame in a single call.
 
yarp::dev::ReturnValue getCameraDescription (yarp::dev::CameraDescriptor &camera) override
 Get a basic description of the camera hw.
 
yarp::dev::ReturnValue hasFeature (yarp::dev::cameraFeature_id_t feature, bool &hasFeature) override
 Check if camera has the requested feature (saturation, brightness ... )
 
yarp::dev::ReturnValue setFeature (yarp::dev::cameraFeature_id_t feature, double value) override
 Set the requested feature to a value (saturation, brightness ... )
 
yarp::dev::ReturnValue getFeature (yarp::dev::cameraFeature_id_t feature, double &value) override
 Get the current value for the requested feature.
 
yarp::dev::ReturnValue setFeature (yarp::dev::cameraFeature_id_t feature, double value1, double value2) override
 Set the requested feature to a value using 2 params (like white balance)
 
yarp::dev::ReturnValue getFeature (yarp::dev::cameraFeature_id_t feature, double &value1, double &value2) override
 Get the current value for the requested feature.
 
yarp::dev::ReturnValue hasOnOff (yarp::dev::cameraFeature_id_t feature, bool &HasOnOff) override
 Check if the camera has the ability to turn on/off the requested feature.
 
yarp::dev::ReturnValue setActive (yarp::dev::cameraFeature_id_t feature, bool onoff) override
 Set the requested feature on or off.
 
yarp::dev::ReturnValue getActive (yarp::dev::cameraFeature_id_t feature, bool &isActive) override
 Get the current status of the feature, on or off.
 
yarp::dev::ReturnValue hasAuto (yarp::dev::cameraFeature_id_t feature, bool &hasAuto) override
 Check if the requested feature has the 'auto' mode.
 
yarp::dev::ReturnValue hasManual (yarp::dev::cameraFeature_id_t feature, bool &hasManual) override
 Check if the requested feature has the 'manual' mode.
 
yarp::dev::ReturnValue hasOnePush (yarp::dev::cameraFeature_id_t feature, bool &hasOnePush) override
 Check if the requested feature has the 'onePush' mode.
 
yarp::dev::ReturnValue setMode (yarp::dev::cameraFeature_id_t feature, yarp::dev::FeatureMode mode) override
 Set the requested mode for the feature.
 
yarp::dev::ReturnValue getMode (yarp::dev::cameraFeature_id_t feature, yarp::dev::FeatureMode &mode) override
 Get the current mode for the feature.
 
yarp::dev::ReturnValue setOnePush (yarp::dev::cameraFeature_id_t feature) override
 Set the requested feature to a value (saturation, brightness ... )
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::IFrameGrabberControls
virtual ~IFrameGrabberControls ()
 Destructor.
 
std::string busType2String (BusType type)
 
FeatureMode toFeatureMode (bool _auto)
 
- Public Member Functions inherited from yarp::dev::IRGBDSensor
virtual ~IRGBDSensor ()
 
virtual yarp::dev::ReturnValue getSensorStatus (RGBDSensor_status &status)=0
 Get the current status of the sensor, using enum type.
 
- Public Member Functions inherited from yarp::dev::IRgbVisualParams
virtual ~IRgbVisualParams ()
 
- Public Member Functions inherited from yarp::dev::IDepthVisualParams
virtual ~IDepthVisualParams ()
 
- Public Member Functions inherited from RGBDSensor_nwc_yarp_ParamsParser
 RGBDSensor_nwc_yarp_ParamsParser ()
 
 ~RGBDSensor_nwc_yarp_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Protected Attributes

yarp::os::Port m_rpcPort
 
RgbImageBufferedPort m_colorFrame_StreamingPort
 
FloatImageBufferedPort m_depthFrame_StreamingPort
 
std::mutex m_mutex
 
RGBDSensorMsgs m_rgbdsensor_RPC
 
yarp::dev::IRGBDSensorsensor_p {nullptr}
 
IRGBDSensor::RGBDSensor_status sensorStatus {IRGBDSensor::RGBD_SENSOR_NOT_READY}
 
int verbose {2}
 
yarp::os::Stamp colorStamp
 
yarp::os::Stamp depthStamp
 
RGBDSensor_StreamingMsgParserstreamingReader {nullptr}
 

Additional Inherited Members

- Public Types inherited from yarp::dev::IRGBDSensor
enum  RGBDSensor_status {
  RGBD_SENSOR_NOT_READY = 0 ,
  RGBD_SENSOR_OK_STANDBY = 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 Attributes inherited from RGBDSensor_nwc_yarp_ParamsParser
const std::string m_device_classname = {"RGBDSensor_nwc_yarp"}
 
const std::string m_device_name = {"RGBDSensor_nwc_yarp"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_period_defaultValue = {"0.03"}
 
const std::string m_localImagePort_defaultValue = {"/RGBD_nwc/Image:o"}
 
const std::string m_localDepthPort_defaultValue = {"/RGBD_nwc/Depth:o"}
 
const std::string m_remoteImagePort_defaultValue = {"/RGBD_nws/Image:o"}
 
const std::string m_remoteDepthPort_defaultValue = {"/RGBD_nws/Depth:i"}
 
const std::string m_localRpcPort_defaultValue = {"/RGBD_nwc/rpc:o"}
 
const std::string m_remoteRpcPort_defaultValue = {"/RGBD_nws/rpc:i"}
 
const std::string m_ImageCarrier_defaultValue = {"udp"}
 
const std::string m_DepthCarrier_defaultValue = {"udp"}
 
double m_period = {0.03}
 
std::string m_localImagePort = {"/RGBD_nwc/Image:o"}
 
std::string m_localDepthPort = {"/RGBD_nwc/Depth:o"}
 
std::string m_remoteImagePort = {"/RGBD_nws/Image:o"}
 
std::string m_remoteDepthPort = {"/RGBD_nws/Depth:i"}
 
std::string m_localRpcPort = {"/RGBD_nwc/rpc:o"}
 
std::string m_remoteRpcPort = {"/RGBD_nws/rpc:i"}
 
std::string m_ImageCarrier = {"udp"}
 
std::string m_DepthCarrier = {"udp"}
 

Detailed Description

RGBDSensor_nwc_yarp: A Network client to receive data from kinect-like devices.

This device will read from two streams of data through different ports, one for the color frame and the other one for depth image following Framegrabber and IDepthSensor interfaces specification respectively. See they documentation for more details about each interface.

This device is paired with its server called RGBDSensor_nws_yarp to receive the data streams and perform remote operations.

Parameters required by this device are shown in class: RGBDSensor_nwc_yarp_ParamsParser

Definition at line 43 of file RGBDSensor_nwc_yarp.h.

Constructor & Destructor Documentation

◆ RGBDSensor_nwc_yarp() [1/3]

RGBDSensor_nwc_yarp::RGBDSensor_nwc_yarp ( )

Definition at line 19 of file RGBDSensor_nwc_yarp.cpp.

◆ RGBDSensor_nwc_yarp() [2/3]

RGBDSensor_nwc_yarp::RGBDSensor_nwc_yarp ( const RGBDSensor_nwc_yarp )
delete

◆ RGBDSensor_nwc_yarp() [3/3]

RGBDSensor_nwc_yarp::RGBDSensor_nwc_yarp ( RGBDSensor_nwc_yarp &&  )
delete

◆ ~RGBDSensor_nwc_yarp()

RGBDSensor_nwc_yarp::~RGBDSensor_nwc_yarp ( )
override

Definition at line 24 of file RGBDSensor_nwc_yarp.cpp.

Member Function Documentation

◆ close()

bool RGBDSensor_nwc_yarp::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 98 of file RGBDSensor_nwc_yarp.cpp.

◆ getActive()

ReturnValue RGBDSensor_nwc_yarp::getActive ( yarp::dev::cameraFeature_id_t  feature,
bool isActive 
)
overridevirtual

Get the current status of the feature, on or off.

Parameters
featurethe identifier of the feature to check
isActiveflag true if the feature is active, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 426 of file RGBDSensor_nwc_yarp.cpp.

◆ getCameraDescription()

ReturnValue RGBDSensor_nwc_yarp::getCameraDescription ( yarp::dev::CameraDescriptor camera)
overridevirtual

Get a basic description of the camera hw.

This is mainly used to determine the HW bus type in order to choose the corresponding interface for advanced controls.

Parameters
devicereturns an identifier for the bus
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 363 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthAccuracy()

ReturnValue RGBDSensor_nwc_yarp::getDepthAccuracy ( double accuracy)
overridevirtual

Get the minimum detectable variation in distance [meter].

Parameters
accuracywill return the sensor resolution in meters.
Returns
true on success

Implements yarp::dev::IDepthVisualParams.

Definition at line 306 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthClipPlanes()

ReturnValue RGBDSensor_nwc_yarp::getDepthClipPlanes ( double nearPlane,
double farPlane 
)
overridevirtual

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.

Definition at line 321 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthFOV()

ReturnValue RGBDSensor_nwc_yarp::getDepthFOV ( double horizontalFov,
double verticalFov 
)
overridevirtual

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.

Definition at line 290 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthHeight()

int RGBDSensor_nwc_yarp::getDepthHeight ( )
overridevirtual

Return the height of each frame.

Returns
depth image height

Implements yarp::dev::IDepthVisualParams.

Definition at line 260 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthImage()

ReturnValue RGBDSensor_nwc_yarp::getDepthImage ( yarp::sig::ImageOf< yarp::sig::PixelFloat > &  depthImage,
yarp::os::Stamp timeStamp = nullptr 
)
overridevirtual

Get the depth frame from the device.

Parameters
depthImagethe depth image to be filled, depth measured in meters.
timeStamptime in which the image was acquired. Optional, ignored if nullptr.
Returns
True on success

Implements yarp::dev::IRGBDSensor.

Definition at line 150 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthIntrinsicParam()

ReturnValue RGBDSensor_nwc_yarp::getDepthIntrinsicParam ( yarp::os::Property intrinsic)
overridevirtual

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
physFocalLength - double m - Yes Physical focal length of the lens in meters
focalLengthX - double pixel - Yes Horizontal component of the focal length as a multiple of pixel width
focalLengthY - double pixel - Yes Vertical component of the focal length as a multiple of pixel height
principalPointX - double pixel - Yes X coordinate of the principal point
principalPointY - double pixel - Yes Y coordinate of the principal point
rectificationMatrix - 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::IDepthVisualParams.

Definition at line 337 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthMirroring()

ReturnValue RGBDSensor_nwc_yarp::getDepthMirroring ( bool mirror)
overridevirtual

Get the mirroring setting of the sensor.

Parameters
mirrortrue if image is mirrored, false otherwise
Returns
true if success

Implements yarp::dev::IDepthVisualParams.

Definition at line 345 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthResolution()

ReturnValue RGBDSensor_nwc_yarp::getDepthResolution ( int width,
int height 
)
overridevirtual

Get the resolution of the depth image from the camera.

Parameters
widthimage width
heightimage height
Returns
true on success

Implements yarp::dev::IDepthVisualParams.

Definition at line 274 of file RGBDSensor_nwc_yarp.cpp.

◆ getDepthWidth()

int RGBDSensor_nwc_yarp::getDepthWidth ( )
overridevirtual

Return the height of each frame.

Returns
depth image height

Implements yarp::dev::IDepthVisualParams.

Definition at line 267 of file RGBDSensor_nwc_yarp.cpp.

◆ getExtrinsicParam()

ReturnValue RGBDSensor_nwc_yarp::getExtrinsicParam ( yarp::sig::Matrix extrinsic)
overridevirtual

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

Implements yarp::dev::IRGBDSensor.

Definition at line 109 of file RGBDSensor_nwc_yarp.cpp.

◆ getFeature() [1/2]

ReturnValue RGBDSensor_nwc_yarp::getFeature ( yarp::dev::cameraFeature_id_t  feature,
double value 
)
overridevirtual

Get the current value for the requested feature.

Parameters
featurethe identifier of the feature to read
valuepointer to current value of the feature, from 0 to 1 expressed as a percentage
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 387 of file RGBDSensor_nwc_yarp.cpp.

◆ getFeature() [2/2]

ReturnValue RGBDSensor_nwc_yarp::getFeature ( yarp::dev::cameraFeature_id_t  feature,
double value1,
double value2 
)
overridevirtual

Get the current value for the requested feature.

Parameters
featurethe identifier of the feature to read
value1returns the current value of the feature, from 0 to 1 expressed as a percentage
value2returns the current value of the feature, from 0 to 1 expressed as a percentage
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 402 of file RGBDSensor_nwc_yarp.cpp.

◆ getImages()

ReturnValue RGBDSensor_nwc_yarp::getImages ( yarp::sig::FlexImage colorFrame,
yarp::sig::ImageOf< yarp::sig::PixelFloat > &  depthFrame,
yarp::os::Stamp colorStamp = nullptr,
yarp::os::Stamp depthStamp = nullptr 
)
overridevirtual

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.

Implements yarp::dev::IRGBDSensor.

Definition at line 162 of file RGBDSensor_nwc_yarp.cpp.

◆ getLastErrorMsg()

ReturnValue RGBDSensor_nwc_yarp::getLastErrorMsg ( std::string &  message,
yarp::os::Stamp timeStamp = nullptr 
)
overridevirtual

Return an error message in case of error.

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

Parameters
messageA string explaining the last error occurred.
Returns
True on success

Implements yarp::dev::IRGBDSensor.

Definition at line 127 of file RGBDSensor_nwc_yarp.cpp.

◆ getMode()

ReturnValue RGBDSensor_nwc_yarp::getMode ( yarp::dev::cameraFeature_id_t  feature,
yarp::dev::FeatureMode mode 
)
overridevirtual

Get the current mode for the feature.

Parameters
featurethe identifier of the feature to change
hasAutoflag true if the feature is has 'auto' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 465 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbFOV()

ReturnValue RGBDSensor_nwc_yarp::getRgbFOV ( double horizontalFov,
double verticalFov 
)
overridevirtual

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.

Definition at line 218 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbHeight()

int RGBDSensor_nwc_yarp::getRgbHeight ( )
overridevirtual

Return the height of each frame.

Returns
rgb image height

Implements yarp::dev::IRgbVisualParams.

Definition at line 180 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbImage()

ReturnValue RGBDSensor_nwc_yarp::getRgbImage ( yarp::sig::FlexImage rgbImage,
yarp::os::Stamp timeStamp = nullptr 
)
overridevirtual

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, ignored if nullptr.
Returns
True on success

Implements yarp::dev::IRGBDSensor.

Definition at line 138 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbIntrinsicParam()

ReturnValue RGBDSensor_nwc_yarp::getRgbIntrinsicParam ( yarp::os::Property intrinsic)
overridevirtual

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
physFocalLength - double m - Yes Physical focal length of the lens in meters
focalLengthX - double pixel - Yes Horizontal component of the focal length as a multiple of pixel width
focalLengthY - double pixel - Yes Vertical component of the focal length as a multiple of pixel height
principalPointX - double pixel - Yes X coordinate of the principal point
principalPointY - double pixel - Yes Y coordinate of the principal point
rectificationMatrix - 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.

Definition at line 234 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbMirroring()

ReturnValue RGBDSensor_nwc_yarp::getRgbMirroring ( bool mirror)
overridevirtual

Get the mirroring setting of the sensor.

Parameters
mirrortrue if image is mirrored, false otherwise
Returns
true if success

Implements yarp::dev::IRgbVisualParams.

Definition at line 242 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbResolution()

ReturnValue RGBDSensor_nwc_yarp::getRgbResolution ( int width,
int height 
)
overridevirtual

Get the resolution of the rgb image from the camera.

Parameters
widthimage width
heightimage height
Returns
true on success

Implements yarp::dev::IRgbVisualParams.

Definition at line 202 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbSupportedConfigurations()

ReturnValue RGBDSensor_nwc_yarp::getRgbSupportedConfigurations ( std::vector< yarp::dev::CameraConfig > &  configurations)
overridevirtual

Get the possible configurations of the camera.

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

Implements yarp::dev::IRgbVisualParams.

Definition at line 194 of file RGBDSensor_nwc_yarp.cpp.

◆ getRgbWidth()

int RGBDSensor_nwc_yarp::getRgbWidth ( )
overridevirtual

Return the width of each frame.

Returns
rgb image width

Implements yarp::dev::IRgbVisualParams.

Definition at line 187 of file RGBDSensor_nwc_yarp.cpp.

◆ getSensorStatus()

ReturnValue RGBDSensor_nwc_yarp::getSensorStatus ( IRGBDSensor::RGBDSensor_status status)
override

Definition at line 118 of file RGBDSensor_nwc_yarp.cpp.

◆ hasAuto()

ReturnValue RGBDSensor_nwc_yarp::hasAuto ( yarp::dev::cameraFeature_id_t  feature,
bool hasAuto 
)
overridevirtual

Check if the requested feature has the 'auto' mode.

Parameters
featurethe identifier of the feature to check
hasAutoflag true if the feature is has 'auto' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 434 of file RGBDSensor_nwc_yarp.cpp.

◆ hasFeature()

ReturnValue RGBDSensor_nwc_yarp::hasFeature ( yarp::dev::cameraFeature_id_t  ,
bool hasFeature 
)
overridevirtual

Check if camera has the requested feature (saturation, brightness ... )

Parameters
featurethe identifier of the feature to check
hasFeatureflag value: true if the feature is present, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 372 of file RGBDSensor_nwc_yarp.cpp.

◆ hasManual()

ReturnValue RGBDSensor_nwc_yarp::hasManual ( yarp::dev::cameraFeature_id_t  feature,
bool hasManual 
)
overridevirtual

Check if the requested feature has the 'manual' mode.

Parameters
featurethe identifier of the feature to check
hasAutoflag true if the feature is has 'manual' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 442 of file RGBDSensor_nwc_yarp.cpp.

◆ hasOnePush()

ReturnValue RGBDSensor_nwc_yarp::hasOnePush ( yarp::dev::cameraFeature_id_t  feature,
bool hasOnePush 
)
overridevirtual

Check if the requested feature has the 'onePush' mode.

Parameters
featurethe identifier of the feature to check
hasAutoflag true if the feature is has 'onePush' mode, false otherwise
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 450 of file RGBDSensor_nwc_yarp.cpp.

◆ hasOnOff()

ReturnValue RGBDSensor_nwc_yarp::hasOnOff ( yarp::dev::cameraFeature_id_t  feature,
bool HasOnOff 
)
overridevirtual

Check if the camera has the ability to turn on/off the requested feature.

Parameters
featurethe identifier of the feature to change
hasOnOffflag true if this feature can be turned on/off, false otherwise.
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 411 of file RGBDSensor_nwc_yarp.cpp.

◆ open()

bool RGBDSensor_nwc_yarp::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 30 of file RGBDSensor_nwc_yarp.cpp.

◆ operator=() [1/2]

RGBDSensor_nwc_yarp & RGBDSensor_nwc_yarp::operator= ( const RGBDSensor_nwc_yarp )
delete

◆ operator=() [2/2]

RGBDSensor_nwc_yarp & RGBDSensor_nwc_yarp::operator= ( RGBDSensor_nwc_yarp &&  )
delete

◆ setActive()

ReturnValue RGBDSensor_nwc_yarp::setActive ( yarp::dev::cameraFeature_id_t  feature,
bool  onoff 
)
overridevirtual

Set the requested feature on or off.

Parameters
featurethe identifier of the feature to change
onofftrue to activate, off to deactivate the feature
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 419 of file RGBDSensor_nwc_yarp.cpp.

◆ setDepthAccuracy()

ReturnValue RGBDSensor_nwc_yarp::setDepthAccuracy ( double  accuracy)
overridevirtual

Set the minimum detectable variation in distance [meter] when possible.

Parameters
thedesired resolution in meters.
Returns
true on success

Implements yarp::dev::IDepthVisualParams.

Definition at line 314 of file RGBDSensor_nwc_yarp.cpp.

◆ setDepthClipPlanes()

ReturnValue RGBDSensor_nwc_yarp::setDepthClipPlanes ( double  nearPlane,
double  farPlane 
)
overridevirtual

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.

Definition at line 330 of file RGBDSensor_nwc_yarp.cpp.

◆ setDepthFOV()

ReturnValue RGBDSensor_nwc_yarp::setDepthFOV ( double  horizontalFov,
double  verticalFov 
)
overridevirtual

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.

Definition at line 299 of file RGBDSensor_nwc_yarp.cpp.

◆ setDepthMirroring()

ReturnValue RGBDSensor_nwc_yarp::setDepthMirroring ( bool  mirror)
overridevirtual

Set the mirroring setting of the sensor.

Parameters
mirrortrue if image should be mirrored, false otherwise
Returns
true if success

Implements yarp::dev::IDepthVisualParams.

Definition at line 353 of file RGBDSensor_nwc_yarp.cpp.

◆ setDepthResolution()

ReturnValue RGBDSensor_nwc_yarp::setDepthResolution ( int  width,
int  height 
)
overridevirtual

Set the resolution of the depth image from the camera.

Parameters
widthimage width
heightimage height
Returns
true on success

Implements yarp::dev::IDepthVisualParams.

Definition at line 283 of file RGBDSensor_nwc_yarp.cpp.

◆ setFeature() [1/2]

ReturnValue RGBDSensor_nwc_yarp::setFeature ( yarp::dev::cameraFeature_id_t  feature,
double  value 
)
overridevirtual

Set the requested feature to a value (saturation, brightness ... )

Parameters
featurethe identifier of the feature to change
valuenew value of the feature, range from 0 to 1 expressed as a percentage
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 380 of file RGBDSensor_nwc_yarp.cpp.

◆ setFeature() [2/2]

ReturnValue RGBDSensor_nwc_yarp::setFeature ( yarp::dev::cameraFeature_id_t  feature,
double  value1,
double  value2 
)
overridevirtual

Set the requested feature to a value using 2 params (like white balance)

Parameters
featurethe identifier of the feature to change
value1first param, from 0 to 1 expressed as a percentage
value2second param, from 0 to 1 expressed as a percentage
Returns
returns true if success, false otherwise (e.g. the interface is not implemented)

Implements yarp::dev::IFrameGrabberControls.

Definition at line 395 of file RGBDSensor_nwc_yarp.cpp.

◆ setMode()

ReturnValue RGBDSensor_nwc_yarp::setMode ( yarp::dev::cameraFeature_id_t  feature,
yarp::dev::FeatureMode  mode 
)
overridevirtual

Set the requested mode for the feature.

Parameters
featurethe identifier of the feature to change
auto_onofftrue to activate 'auto' mode, false to activate 'manual' mode
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 458 of file RGBDSensor_nwc_yarp.cpp.

◆ setOnePush()

ReturnValue RGBDSensor_nwc_yarp::setOnePush ( yarp::dev::cameraFeature_id_t  feature)
overridevirtual

Set the requested feature to a value (saturation, brightness ... )

Parameters
featurethe identifier of the feature to change
valuenew value of the feature, from 0 to 1 as a percentage of param range
Returns
returns true on success, false on failure.

Implements yarp::dev::IFrameGrabberControls.

Definition at line 473 of file RGBDSensor_nwc_yarp.cpp.

◆ setRgbFOV()

ReturnValue RGBDSensor_nwc_yarp::setRgbFOV ( double  horizontalFov,
double  verticalFov 
)
overridevirtual

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.

Definition at line 227 of file RGBDSensor_nwc_yarp.cpp.

◆ setRgbMirroring()

ReturnValue RGBDSensor_nwc_yarp::setRgbMirroring ( bool  mirror)
overridevirtual

Set the mirroring setting of the sensor.

Parameters
mirrortrue if image should be mirrored, false otherwise
Returns
true if success

Implements yarp::dev::IRgbVisualParams.

Definition at line 250 of file RGBDSensor_nwc_yarp.cpp.

◆ setRgbResolution()

ReturnValue RGBDSensor_nwc_yarp::setRgbResolution ( int  width,
int  height 
)
overridevirtual

Set the resolution of the rgb image from the camera.

Parameters
widthimage width
heightimage height
Returns
true on success

Implements yarp::dev::IRgbVisualParams.

Definition at line 211 of file RGBDSensor_nwc_yarp.cpp.

Member Data Documentation

◆ colorStamp

yarp::os::Stamp RGBDSensor_nwc_yarp::colorStamp
protected

Definition at line 64 of file RGBDSensor_nwc_yarp.h.

◆ depthStamp

yarp::os::Stamp RGBDSensor_nwc_yarp::depthStamp
protected

Definition at line 65 of file RGBDSensor_nwc_yarp.h.

◆ m_colorFrame_StreamingPort

RgbImageBufferedPort RGBDSensor_nwc_yarp::m_colorFrame_StreamingPort
protected

Definition at line 53 of file RGBDSensor_nwc_yarp.h.

◆ m_depthFrame_StreamingPort

FloatImageBufferedPort RGBDSensor_nwc_yarp::m_depthFrame_StreamingPort
protected

Definition at line 54 of file RGBDSensor_nwc_yarp.h.

◆ m_mutex

std::mutex RGBDSensor_nwc_yarp::m_mutex
protected

Definition at line 56 of file RGBDSensor_nwc_yarp.h.

◆ m_rgbdsensor_RPC

RGBDSensorMsgs RGBDSensor_nwc_yarp::m_rgbdsensor_RPC
protected

Definition at line 57 of file RGBDSensor_nwc_yarp.h.

◆ m_rpcPort

yarp::os::Port RGBDSensor_nwc_yarp::m_rpcPort
protected

Definition at line 50 of file RGBDSensor_nwc_yarp.h.

◆ sensor_p

yarp::dev::IRGBDSensor* RGBDSensor_nwc_yarp::sensor_p {nullptr}
protected

Definition at line 60 of file RGBDSensor_nwc_yarp.h.

◆ sensorStatus

IRGBDSensor::RGBDSensor_status RGBDSensor_nwc_yarp::sensorStatus {IRGBDSensor::RGBD_SENSOR_NOT_READY}
protected

Definition at line 61 of file RGBDSensor_nwc_yarp.h.

◆ streamingReader

RGBDSensor_StreamingMsgParser* RGBDSensor_nwc_yarp::streamingReader {nullptr}
protected

Definition at line 68 of file RGBDSensor_nwc_yarp.h.

◆ verbose

int RGBDSensor_nwc_yarp::verbose {2}
protected

Definition at line 62 of file RGBDSensor_nwc_yarp.h.


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