service exception using tf listener in rospy
I get a service exception whenever I call lookupTransform for tf.TransformListner.
tf_listener = tf.TransformListener()
tf_listener.waitForTransform( reference_link, end_effector_link, rospy.Time(), rospy.Duration(4.0))
(posn, rotn) = tf_listener.lookupTransform(reference_link, end_effector_link, rospy.Time())
This is the service exception:
Exception in thread Thread-18:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/opt/ros/diamondback/stacks/geometry/tf/src/tf/listener.py", line 237, in run
self.tl.frame_graph_server = rospy.Service('~tf_frames', FrameGraph, self.frame_graph_service)
File "/opt/ros/diamondback/stacks/ros_comm/clients/rospy/src/rospy/impl/tcpros_service.py", line 682, in __init__
get_service_manager().register(self.resolved_name, self)
File "/opt/ros/diamondback/stacks/ros_comm/clients/rospy/src/rospy/service.py", line 120, in register
raise ServiceException(err)
ServiceException: service [/test_code_22488_1312164786316/tf_frames] already registered
The tf_listener is initialized within a python function definition. The output of the lookupTransform is otherwise fine (the position and rotation are correct and functional). I just want to get rid of the exception always printing out the screen about the service being already registered.