tf.LookupException: "base_link" passed to lookupTransform argument target_frame does not exist.
Hello together,
I am new with ros tf's and already worked myself threw the tf tutorials. (I am using ros indigo) As my first test with tf's after the tutorial I wrote 2 small nodes.
The first one is sending a tf:
#!/usr/bin/env python
import rospy
import tf
class tf_firsttry_pub_class():
def __init__(self):
rospy.init_node('tf_firsttry_pub')
now = rospy.Time.now()
br = tf.TransformBroadcaster()
while not rospy.is_shutdown():
br.sendTransform((1, 1, 1), (0, 0, 0, 1), rospy.Time(), 'one','base_link')
rospy.Rate(50)
if __name__ == '__main__':
try:
tf_firsttry_pub_class()
except rospy.ROSInterruptException:
pass
The second is listening to the tf:
#!/usr/bin/env python
import rospy
import tf
class tf_firsttry_listen_class():
def __init__(self):
rospy.init_node('tf_firsttry_listen')
listener = tf.TransformListener()
now = rospy.Time.now()
while not rospy.is_shutdown():
(trans,rot)=listener.lookupTransform('/base_link','/one',rospy.Time(0))
print trans
if __name__ == '__main__':
try:
tf_firsttry_listen_class()
except rospy.ROSInterruptException:
pass
When starting the second node this error occurs:
line 11, in __init__ (trans,rot)=listener.lookupTransform('/base_link','/one',rospy.Time(0)) tf.LookupException: "base_link" passed to lookupTransform argument target_frame does not exist.
I already found in a different question that a try: except:
shell around the listener could help as it may only fail at the beginning but that doesn't help.
As you see the code is easy but I am totally stuck. I think I misunderstood something but can't figure out what.
Any solutions?
Thanks in advance!