Skip to content

Commit

Permalink
RGBDSensorWrapper: make the view of IFrameGrabberControl optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogene committed Sep 26, 2018
1 parent 3bc7048 commit ad65495
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/libYARP_dev/src/devices/RGBDSensorWrapper/RGBDSensorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,22 +385,6 @@ bool RGBDSensorWrapper::openAndAttachSubDevice(Searchable& prop)
if(!attach(subDeviceOwned))
return false;

if(!rgbdParser.configure(sensor_p) || !rgbdParser.configure(fgCtrl))
{
yError() << "RGBD wrapper: error configuring interfaces for parsers";
return false;
}

/*
bool conf = rgbParser.configure(rgbVis_p);
conf &= depthParser.configure(depthVis_p);
if(!conf)
{
yError() << "RGBD wrapper: error configuring interfaces for parsers";
return false;
}
*/
return true;
}

Expand Down Expand Up @@ -577,14 +561,14 @@ bool RGBDSensorWrapper::attach(yarp::dev::IRGBDSensor *s)
return false;
}
sensor_p = s;
if(!rgbdParser.configure(sensor_p) )
if(!rgbdParser.configure(sensor_p))
{
yError() << "RGBD wrapper: error configuring interfaces for parsers";
return false;
}
if (fgCtrl)
{
if(!rgbdParser.configure(fgCtrl) )
if(!rgbdParser.configure(fgCtrl))
{
yError() << "RGBD wrapper: error configuring interfaces for parsers";
return false;
Expand All @@ -609,11 +593,17 @@ bool RGBDSensorWrapper::attach(PolyDriver* poly)
return false;
}

if(!rgbdParser.configure(sensor_p) || !rgbdParser.configure(fgCtrl))
if(!rgbdParser.configure(sensor_p))
{
yError() << "RGBD wrapper: error configuring interfaces for parsers";
yError() << "RGBD wrapper: error configuring IRGBD interface";
return false;
}

if (!rgbdParser.configure(fgCtrl))
{
yWarning() <<"RGBDWrapper: interface IFrameGrabberControl not implemented by the device";
}

PeriodicThread::setPeriod(period);
return PeriodicThread::start();
}
Expand Down

0 comments on commit ad65495

Please sign in to comment.