gazebo-yarp-plugins icon indicating copy to clipboard operation
gazebo-yarp-plugins copied to clipboard

Cannot call IRGBDSensor::getRgbResolution() when using a gazebo_yarp_camera plugin

Open xEnVrE opened this issue 8 months ago • 12 comments

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 the IRGBDSensorInterface.

While the calls IRGBDSensor::getRgbWidth() -> int and IRGBDSensor::getRgbHeight() -> int return the correct values, the method IRGBDSensor::getRgbResolution(int&, int&) -> bool always return false.

After a bit of investigation, it seems that the rpc responder responsible for that call is calling getRgbResolution on a yarp::dev::IRgbVisualParams instance whose default implementation is to return 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 the GazeboYarpCameraDriver class is inheriting from yarp::dev::IFrameGrabberImage. The latter interface has, among others, two methods height() and width().

I could not reconstruct the missing path from IFrameGrabberImage to the IRgbVisualParams unfortunately. Is anyone willing to clarify this connection? Am I using the wrong device interface IRGBDSensorInterface 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

xEnVrE avatar Nov 01 '23 20:11 xEnVrE