robotology / cer-sim

Official URDF and SDF models of the R1 humanoid robot.
15 stars 9 forks source link

fixed cameras configuration #15

Closed valegagge closed 5 years ago

valegagge commented 5 years ago

In this PR I updated the configuration files of cameras in order to fix following errors: 1) address conflict: the wrappers of the multicamera and xtion camera rgb open the port with the same name: Port /SIM_CER_ROBOT/cam/cameras:o active at tcp://10.240.11.23:10006/ 2) use older version of device grabber: updated with GrabberDual 3) the RGBDSensorWrapper opened a port rpc called SIM_CER_ROBOT/rpc: the name is not clear.

Now the following ports are available: /SIM_CER_ROBOT/rgbImage:o ==> stream of Leopard cameras /SIM_CER_ROBOT/xtion/rgbImage:o ==> stream of xtion rgb image /SIM_CER_ROBOT/xtionrgb/cameras:o ==> stream of xtion depth image /SIM_CER_ROBOT/cam/cameras:o/rpc ==> awful name of rpc of Leopard cameras /SIM_CER_ROBOT/xtion/rpc:i ==> rpc port of xtion

Moreover note that there is the following error:

[ERROR]MUltiCamera: Unable to get the iFrameGrabberImage interface from the device

This error is not correct, because the view is done on the wrapper instead of on device; so I propose to open an issue to fix it.

Thanks to @barbalberto for his help!

jchevrie commented 5 years ago

Thanks.

Several remarks/questions that come to my mind:

I would suggest to use more generic names for the cameras, like depthCamera instead of xtion and stereoCamera instead of cam/cameras:o. Mainly since the Xtion is only used on the R1-mk1 while R1-mk2 uses a RealSense (and at some point we should probably provide two separate cer.sdf files for the different versions of R1).

Also are you sure about the ports that are available after your changes? Tell me if I'm wrong, but I think you should have: /SIM_CER_ROBOT/rgbImage:o ==> should not exist anymore /SIM_CER_ROBOT/xtion/rgbImage:o ==> stream of xtion rgb image /SIM_CER_ROBOT/xtionrgb/cameras:o ==> another stream of xtion *rgb image (seems redundant with the previous one, see remark below?) /SIM_CER_ROBOT/cam/cameras:o/rpc ==> awful name of rpc of Leopard cameras /SIM_CER_ROBOT/xtion/rpc:i ==> rpc port of xtion /SIM_CER_ROBOT/cam/cameras:o ==> stream of stereo images (Leopart cameras?) /SIM_CER_ROBOT/xtion/depthImage:o ==> stream of xtion depth map

Actually I don't know what is the purpose of gazebo_cer_xtion_camera_rgb.ini since the rgb of the Xtion is already modeled by the RGBDSensorWrapper in gazebo_cer_depthCamera.ini.

valegagge commented 5 years ago

I'm agree with you, the name are not appropriate completely. I prefer to use rgbd or multicamera instead of depth camera because it seems only depth stream. As suggested me @barbaalberto, we can use something similar in the real robot. Asap I'll che the names, now I'm answering by my phone.

About the ports: /rgb:o is the output of rgb stereo cameras(leopard), while /xtionrgb is the output rgb of xtion(rgbd camera).

About you RGBDSensorWrapper you ate right, but I think gazebo needs to simulate the three cameras sensors in separate way: stereo cameras, depth and rgb. Even if we are used to think rgbd like one sensor, it is composed by two distinct sensos: rgb and depth. Maybe i'wrong ...we can get more in detail...

valegagge commented 5 years ago

In this commit I updated the port name taking into account names used in R1 real robot configuration files. Recap on gazebo we have the stereo camera simulated with multicamera and GrabberDual wrapper that opens these output port

and a depth camera. On real robot it is configured like a unique sensor and use the wrapper RGBDSensorWrapper that opens two port /depthCamera/depthImage:o and /depthCamera/rgbImage:o to stream depth and rgb images rispectively. In Gazebo, in the sdf file of R1, the depth camera is composed by two sensor, simulated by two plugin and two wrapper: the depth uses RGBDSensorWrapper and libgazebo_yarp_depthCamera plugin, while rgb needs libgazebo_yarp_camera and grabber wrapper. Defining two sensors for the depth camera envolves in get one redoundant port:

So //depthCamera/rgbImage:o and //depthCamera_rgb/camera:o have the same stream. I think the use of two sensor is due to the different position of these sensor. In fact on sdf file they have different values in pose tag. I'm not sure this is the correct motivation, so I'd like to ask to @randaz81 end/or @traversaro more explanation.

traversaro commented 5 years ago

I'm not sure this is the correct motivation, so I'd like to ask to @randaz81 end/or @traversaro more explanation.

I have limited experienced with R1, so I can not be of a big help in this case. : (

pattacini commented 5 years ago

Let me add @barbalberto and @Nicogene in the loop since they developed the driver of the real sensor.