49 rospy.wait_for_service(
'add_two_ints')
54 metadata = {
'cookies' :
'peanut butter' }
55 add_two_ints = rospy.ServiceProxy(
'add_two_ints', AddTwoInts, headers=metadata)
57 print "Requesting %s+%s with cookies=%s"%(x, y, metadata[
'cookies'])
61 print "Server's connection headers were", resp._connection_header
64 except rospy.ServiceException, e:
65 print "Service call failed: %s"%e
68 return "%s [x y]"%sys.argv[0]
70 if __name__ ==
"__main__":
72 if len(sys.argv) == 1:
74 x = random.randint(-50000, 50000)
75 y = random.randint(-50000, 50000)
76 elif len(sys.argv) == 3:
79 x = string.atoi(sys.argv[1])
80 y = string.atoi(sys.argv[2])