python tf listener not able to get tf in a connected tree
Hello,
I have a problem with tf listener. I've created a package that you can try to see if the same error happens to you. You can get it from here.
Let me explain the set up. In the package there are two xacro files. I use this xacro files to create two robots. For both I set up a parameter ( simple_arm
and simple_arm2
) loading the xacro file into them, and then I create a robot_state_publisher
and a joint_state_publisher
for each one by remapping the robot_description
parameter to either one of the parameters ( simple_arm
and simple_arm2
). Finally I manually publish two tf using static_transform_publisher
in tf
package to link the two arms. This tf are from a common reference frame (which I call rviz) to each one of the bases. You can visualize this part by launching roslaunch tf_test xacro.launch
. This will launch also rviz where you can see that all the two models are there and the tf tree is conected (see the tf tree below).
The problem I have is that, when I try to recover the tf between link0_0
and link0_1
I get the following error if I use the python tf package:
Exeption caught: Could not find a connection between 'link0_0' and 'link0_1' because they are not part of the same tree.Tf has two or more unconnected trees.
If I use the cpp package, then I get a tf between both frames. For you to note that, I've created two listeners, one in cpp and one in python. They "do the same" in both languages but the cpp works and the py does not. You can launch both nodes using roslaunch tf_test tf_test.launch
which in my case outputs the following:
[ INFO] [1464960739.644812237]: /tf_test_cpp: got tf!
[ERROR] [WallTime: 1464960740.034864] /tf_test_py: Exeption caught: Could not find a connection between 'link0_0' and 'link0_1' because they are not part of the same tree.Tf has two or more unconnected trees.
Which I think makes no sense. The problem is that I need this subscriber in python since all my robot controlling code is using that language. Does anybody have any idea on what to do?
Thank you!
Asked by apalomer on 2016-06-03 08:43:06 UTC
Comments