ADVRHumanoids / iit-centauro-ros-pkg

2 stars 0 forks source link

Integrate the d435 root frame into the robot urdf as a new fixed link #29

Closed torydebra closed 2 years ago

torydebra commented 2 years ago

simpler version of #26, since there are not "tracking frames" to consider.

I simply added the frames in the xbot model (outside the xacro::if ADD_D435) such that xbot will publish also the tf up to the D435 root. If you do not use camera, no problem. If you use them simulated, no changes happened because all the modifications are inside the xacro::unless ADD_D435 If you use them real (when using the real robot) now xbot will publish tf until D435_head_camera_link. After launching the launch file of realsense, this will publish the tf (publish_tf launch arg is default set to true) from <camera_name>_link up to the leaves of the camera tree.

d435

Just be sure to launch the roslaunch file of realsense with the correct , eg for the head camera: camera:=D435_head_camera

I have done this only for the head camera for now.

Some notes

1- To add the link in the model urdf, even when ADD_D435 is not used, we need the camera mesh. As @alaurenzi suggest I have put the mesh of the camera in the centauro repository, so one does not need to install the realsense_description repo if he does not use the camera. Alternative is to put a simple box:

          <!-- <box size="${d435_cam_width} ${d435_cam_height} ${d435_cam_depth}"/> -->
          <mesh filename="package://centauro_urdf/meshes/realsense/d435.dae"/>

2- I noticed that real D435 and simulated ones have slightly different trees :

real d435_real

simulated d435_simulated

Not only the simulated publish more tf, but also the structure is slight different (depth in the simulated is father of color, in the real depth is a brother.

Also the resultant transformation are slightly different: real rosrun tf tf_echo test_link test_color_optical_frame At time 0.000

sim (xacro from our repo) rosrun tf tf_echo D435_head_camera_link D435_head_camera_color_optical_frame At time 1643371238.466

sim (xacro from official realsense repo) rosrun tf tf_echo D435_head_camera_link D435_head_camera_color_optical_frame At time 1643371953.007

Xacro of our repo and official realsense gives same results, so this is probably a problem of the official realsense. I do not know if this may cause some issue, and if this happens also for T265 and velodyne

torydebra commented 2 years ago

closing as merged