`tf static_transform_publisher` removes link instead of linking two tf trees
When using static_transform_publisher
, attempting to link to coordinate systems via a common frame the publisher removes the link from one tree and places it in the other. This happens both with tf
and tf2_ros
, and when execucted from the command line as well as from a launch file.
See the following example where ar_marker_master
and ar_marker_0
refer to the same point in world space. Without linking the two using tf
, the tf_tree
looks like this:
Then, we can attempt to link the two frames using:
rosrun tf static_transform_publisher 0 0 0 0 0 0 /ar_marker_master /ar_marker_0 1000
Where the resulting tree looks like this:
This successfully links ar_marker_master
with ar_marker_0
, but notice that the link ar_marker_0
has been removed from the tree with camera_link
. Shouldn't this join the two trees?
For more context, if I run rosrun tf tf_echo /camera_color_optical_frame /ar_marker_0
to view the transformation between camera_color_optical_frame
and ar_marker_0
before the adding the link, I can see:
At time 1556317303.088
- Translation: [-0.380, 0.338, 1.264]
- Rotation: in Quaternion [0.966, 0.072, -0.068, 0.237]
in RPY (radian) [2.669, 0.166, 0.109]
in RPY (degree) [152.939, 9.504, 6.273]
But after running static_transform_publisher
:
Exception thrown:Could not find a connection between 'camera_color_optical_frame' and 'ar_marker_0'
Where did the link go? And, if this is not the proper way to join two trees, how should I perform the transform to join the two coordinate systems?