ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The response is returned by the call. See this tutorial: http://www.ros.org/wiki/ROS/Tutorials/WritingServiceClient(python)
2 | No.2 Revision |
The response is returned by the call. See this tutorial: http://www.ros.org/wiki/ROS/Tutorials/WritingServiceClient(python)
You need to adapt this code to yours:
rospy.wait_for_service('add_two_ints')
try:
add_two_ints = rospy.ServiceProxy('add_two_ints', AddTwoInts)
resp1 = add_two_ints(x, y)
return resp1.sum
except rospy.ServiceException, e:
print "Service call failed: %s"%e