Open xEnVrE opened 1 year ago
I am connecting to the camera with a
PolyDriver
using theIRGBDSensorInterface
, i.e. as "nwc" (network wrapper client)?
Which device are you using for opening the PolyDriver
? RGBDSensorClient
or frameGrabber_nwc_yarp
? Which version of YARP?
I am using RGBDSensorClient just because I was used to do that on the real robot.
Version of YARP is 3.8.1
.
Sorry, last question, which model are you using for simulation? Which gyp version?
I am using
ergoCubGazeboV1_1
and forgyp
I am using latestdevel
.The camera I am interacting with is, I guess, exposed by this wrapper loaded by the
yarprobotinterface
plugin.
Thanks, this is what I was looking for! So the server side is rgbdSensor_nws_yarp
, and the complete call is:
Ok, in the case you are using RGBDSensorClient
and YARP 3.8.1 the call path should be:
Not sure what the false came out, but my guess is that we should implement the proper interface for the gazebo_yarp_camera
, as done for the gazebo_yarp_multicamera
in https://github.com/robotology/gazebo-yarp-plugins/pull/558 .
Not sure what the false came out
Probably in https://github.com/robotology/yarp/blob/65a3a508c0b5147bdf5106ac173370382486004e/src/devices/framegrabber_protocol/yarp/proto/framegrabber/RgbVisualParams_Responder.cpp#L30 ? Did you checked if gazebo prints that error?
Or perhaps we should just use gazebo_yarp_multicamera
also on ergoCub as that device provides all the functionality of gazebo_yarp_camera
? Not an expert of that part, perhaps @Nicogene or @randaz81 may know more.
I checked but the error is not there. Moreover, some of the other calls are actually working, e.g., I am getting the correct answer for
and
I am also testing them without C++ using yarp rpc
directly, basically mimiking the forwarder
.
I can get the width
, or the height
using h
, with
yarp rpc /ergocubSim/depthCamera/rpc:i
visr get w
and I get
Response: [visr] [w] [is] 640
However, if I try to get the resolution
yarp rpc /ergocubSim/depthCamera/rpc:i
visr get res
I get
Response: [fail]
Not an expert of that part, perhaps @Nicogene or @randaz81 may know more.
Indeed maybe we can ask them first to understand a bit better! Thanks for the help in understanding the list of calls along the process!
Looking at the code it seems that gazebo_yarp_camera
does not inherit from IRGBVisualParams
or the IRGBDSensorsInterface so it surprise to me that the poly->view()
is working.
@randaz81 are IFrameGrabber
and IRGBVisualParams
sharing the same protocol?
In any case since gazebo_yarp_camera
implements only the width
and height
methods I think it is correct that visr get res
fails
IRGBVisualParams or the IRGBDSensorsInterface so it surprise to me that the poly->view() is working.
Isn't that because there is an extra layer made by the rgbdSensor_nws_yarp
at the server side? - I mean that the yarprobotinteface
plugin is initializing that wrapper that in turn is getting data from the Gazebo device implementing IFrameGrabber
.
IRGBVisualParams or the IRGBDSensorsInterface so it surprise to me that the poly->view() is working.
Isn't that because there is an extra layer made by the
rgbdSensor_nws_yarp
at the server side? - I mean that theyarprobotinteface
plugin is initializing that wrapper that in turn is getting data from the Gazebo device implementingIFrameGrabber
.
Yes, you are right, but then under the nws the device does not implement the getResolution
method, this is why it fails.
And probably yes there is one rpc protocol for both interface
I am trying to retrieve the resolution of a camera running in simulation from a robot using the
gazebo_yarp_camera
plugin.I am connecting to the camera with a
PolyDriver
using theIRGBDSensorInterface
.While the calls
IRGBDSensor::getRgbWidth() -> int
andIRGBDSensor::getRgbHeight() -> int
return the correct values, the methodIRGBDSensor::getRgbResolution(int&, int&) -> bool
always returnfalse
.After a bit of investigation, it seems that the rpc responder responsible for that call is calling
getRgbResolution
on ayarp::dev::IRgbVisualParams
instance whose default implementation is toreturn false
- and that method is not pure virtual, hence it might be that the simulation plugin is not re-implementing that call (but I might be wrong as I am not really an expert on client/server architectures of rgb devices in YARP).What I noticed is that the
gazebo_yarp_camera
plugin, more specifically theGazeboYarpCameraDriver
class is inheriting fromyarp::dev::IFrameGrabberImage
. The latter interface has, among others, two methodsheight()
andwidth()
.I could not reconstruct the missing path from
IFrameGrabberImage
to theIRgbVisualParams
unfortunately. Is anyone willing to clarify this connection? Am I using the wrong device interfaceIRGBDSensorInterface
to connect to a simulated camera or is the plugin missing the implementation of some methods / interfaces?I am available for a PR in case someone could help understand the missing links :)
cc @traversaro