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

service exception using tf listener in rospy

asked 2011-07-31 14:25:40 -0500

Nash gravatar image

updated 2014-01-28 17:10:08 -0500

ngrennan gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2011-08-01 13:54:41 -0500

tfoote gravatar image

I believe this is actually in the constructor. tf.TransformListener advertises that service as a debugging tool. In the c++ version it checks it it has been advertised and doesn't do so again if it's already been done so by a different Listener. If you want to look into the code, the conditional execution could be added in the run method in TransformListenerThread in tf/src/tf/listener.py.

edit flag offensive delete link more

Comments

1

This bug is still around. You are right, Tully. That exception is only thrown on creation of a tf listener. I posted a "ticket on github": https://github.com/ros/ros_comm/issues/18.

bit-pirate gravatar image bit-pirate  ( 2012-11-09 15:53:02 -0500 )edit

As this seems to be not fixed on Fuerte as of today I created a patch and want to share it. Therefore the following pull request has been created: https://github.com/ros/geometry/pull/26

Sebastian Rockel gravatar image Sebastian Rockel  ( 2013-08-01 04:46:45 -0500 )edit

Is it fixed for Indigo? I got it and don't know whether its something in my code or the repo itself.

lahiruherath gravatar image lahiruherath  ( 2018-05-29 07:25:08 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2011-07-31 14:25:40 -0500

Seen: 2,143 times

Last updated: Aug 01 '11