Rosanswers logo

Hey guys,

I'm using urdf withrviz to do forward kinematics related problem. My question is can we get the results of tf_echo in a script? Also, I'm looking for suggestions why this problem happened.

I could use

rosrun tf tf_echo /base /tool0

to get the correct result:

At time 1499215724.972

  • Translation: [0.410, 0.191, 0.947]
  • Rotation: in Quaternion [0.707, 0.000, -0.000, 0.707] in RPY (radian) [1.571, 0.000, 0.000] in RPY (degree) [89.997, 0.008, 0.004]

Yet, I couldn't use

(trans, rot) = listener.lookupTransform('base', 'tool0', rospy.Time(0)), refer to here to get the transform, it would throw an exception.

I also tried

now = rospy.Time.now()

listener.waitForTransform("base", "tool0", now, rospy.Duration(10.0)) tf.Exception: . canTransform returned after 10.0023 timeout was 10.

I chagned 10 here to 0.01, 1, etc. and it always gives similar exception.

Originally posted by thompson104 on ROS Answers with karma: 43 on 2017-07-04

Post score: 1

Original comments

Comment by surajmshanbhag on 2017-09-16:
I am having the exact same issue. using tf2 didnt help. Did you solve it ?

Comment by thompson104 on 2017-10-31:
Yes actually, I followed the tutorial in TF2 and it solved my question, you get the same error?


1 Answer 1


Rosanswers logo

I had a local scope for the buffer which made it fail. In the tutorials its mentioned "The TransformListener object should be scoped to persist otherwise it's cache will be unable to fill and almost every query will fail". This fixed the issue.

Originally posted by surajmshanbhag with karma: 61 on 2017-09-16

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.