IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.59k stars 1.76k forks source link

Incorrect TF frame `camera_link` when using `view_d435_model.launch` #497

Closed peci1 closed 5 years ago

peci1 commented 6 years ago

When you are viewing the model using view_d435_model.launch, this is the TF you get:

rosrun tf tf_echo camera_link camera_depth_frame
At time 1539958677.743
- Translation: [0.015, 0.018, 0.013]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY (radian) [0.000, -0.000, 0.000]
            in RPY (degree) [0.000, -0.000, 0.000]

Whereas with the live camera, you get:

rosrun tf tf_echo camera_link camera_depth_frame
At time 0.000
- Translation: [0.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY (radian) [0.000, -0.000, 0.000]
            in RPY (degree) [0.000, -0.000, 0.000]

Indeed, in the xacro file used in viewing, there is a non-zero transform between camera_link and camera_depth_frame, whereas in the driver source, camera_link and camera_depth_frame coincide.

I assume the XACRO file should be fixed.

atyshka commented 6 years ago

@doronhi Here is a detailed video of the issue. I started the model which had the correct transforms but then everything is offset when the driver is started. peek 2018-11-13 10-36

When the driver is started the frames no longer line up with the geometry. @peci1 recommends changing the xacro, but I like the origin where it is. The mounting point is a lot more logical than the 0 point corner of the model. I'd propose either changing the transforms in the driver to match the xacro or adding a launch file param to disable tf publishing if static transforms are already being published by a robot state publisher. I'd opt for the second option, many other sensors use this parameter and it won't change behavior unless used.

atyshka commented 5 years ago

@doronhi Any suggestions on how you'd like to handle this issue?