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>_linkup to the leaves of the camera tree.
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:
2- I noticed that real D435 and simulated ones have slightly different trees :
real
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
Translation: [-0.000, 0.015, -0.000]
Rotation: in Quaternion [-0.500, 0.498, -0.501, 0.500]
in RPY (radian) [-1.567, -0.002, -1.570]
in RPY (degree) [-89.803, -0.139, -89.967]
sim (xacro from our repo)
rosrun tf tf_echo D435_head_camera_link D435_head_camera_color_optical_frame
At time 1643371238.466
Translation: [0.000, 0.015, 0.000]
Rotation: in Quaternion [-0.500, 0.500, -0.500, 0.500]
in RPY (radian) [-1.571, -0.000, -1.571]
in RPY (degree) [-90.000, -0.000, -90.000]
sim (xacro from official realsense repo)
rosrun tf tf_echo D435_head_camera_link D435_head_camera_color_optical_frame
At time 1643371953.007
Translation: [0.000, 0.015, 0.000]
Rotation: in Quaternion [-0.500, 0.500, -0.500, 0.500]
in RPY (radian) [-1.571, -0.000, -1.571]
in RPY (degree) [-90.000, -0.000, -90.000]
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
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 thexacro::unless ADD_D435
If you use them real (when using the real robot) now xbot will publish tf untilD435_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.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:
2- I noticed that real D435 and simulated ones have slightly different trees :
real
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