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

Revision history [back]

click to hide/show revision 1
initial version

The response is returned by the call. See this tutorial: http://www.ros.org/wiki/ROS/Tutorials/WritingServiceClient(python)

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