ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to resolve waitForTransform timeout exception regardless of Duration value in ROS Kinetic (python)?

asked 2017-06-27 16:07:47 -0600

nemesis gravatar image

updated 2017-06-27 16:14:25 -0600

I have gone through similar questions on this website, but none have helped resolve the problem for me.

listener.waitForTransform("world", "camera_link", rospy.Time(0), rospy.Duration(4.0))

  • My TF tree is well defined and shows the connection between the two frames (world and a camera frame). It's World -> Link 1 -> Link 2 -> Camera Link I check this based on rqt-graph.
  • If I replace "world" above with "Link 2" I don't get the timeout exception, which is interesting.
  • As I mentioned, changing Duration doesn't help.
  • The use_sim_time parameter is also defined and set to True.

Not sure how to proceed on this at all.

Something which might be important -

I am working through VMWare. Due to some issue with vmware tools, I had to run the sudo apt-get autoremove command. Which, unfortunately, ended up removing some of the ROS packages. So I am thinking that might be related to this problem, but I can't be sure. I have tried reinstalling the tf, tf2, geometry packages till now becacuse some posts suggested it to be a problem related to those. Didn't help.

Any idea on how to debug/solve this? I can provide more information if required.


Just after posting this, I tried to run tf_echo for those two. And I get this error -

Exception thrown:Could not find a connection between 'camera_link' and 'world' because they are not part of the same tree.Tf has two or more unconnected trees.

Which is weird and interesting because this seems to contradict the first point I have above.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-27 18:44:45 -0600

nemesis gravatar image

updated 2017-06-27 18:47:53 -0600

As it turns out, it's a known issue and it seems the fix hasn't been merged properly yet to a specific version. The main clue here was the tf view_frames didn't show the world frame but rqt did. That caused a problem since the issue is related to tf_static as pointed by the issues/pull request below.

The issue above - 136, mentions a workaround. To set the use_tf_static parameter to false for the robot_state_publisher.

It's as simple as

 <arg name="use_tf_static" default="false"/> 
 <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" >
          <param name="use_tf_static" value="$(arg use_tf_static)"/>

For now, this seems to fix the problem. I will work with this and see if there's any issues, but for now I think this answers my original question.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-06-27 16:07:47 -0600

Seen: 755 times

Last updated: Jun 27 '17