this is documented ros-behaviour: http://wiki.ros.org/rospy/Overview/Services#Persistent_connections
but team FlexIRoc calls this service at high rates which caused an exception beeing thrown after a few seconds:
- Code: Select all
Traceback (most recent call last):
...
system.set_servo_target(system.lwr_joints, current_command)
File "/opt/euroc_c2s1/ros/install/lib/euroc_c2_demos/euroc_c2_system.py", line 326, in set_servo_target
resp = set_servo_target_service(joint_names, target)
File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in __call__
return self.call(*args, **kwds)
File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 505, in call
raise ServiceException("unable to connect to service: %s"%e)
rospy.service.ServiceException: unable to connect to service: [Errno -5] No address associated with hostname
as documented in the ros-documentation above we changed our demo code to set the persistent keyword argument to the rospy.ServiceProxy constructor to True for the set_servo_target service. (will be avaliable in euroc-c2s1-interface_1.0.18_i386.deb, to be released soon)
we recommend that you check your solution code how often you call set_servo_target and in case you call it frequently you should use a persistent ros service connection (refer to ros documentation for more info about this)