Complete the code to import the ROS service client library.
from [1] import ServiceProxy
You need to import ServiceProxy from rospy to create a service client in ROS.
Complete the code to create a service client for the 'add_two_ints' service.
client = ServiceProxy('[1]', AddTwoInts)
The service name must include the leading slash / to correctly specify the service in ROS.
Fix the error in the code to call the service client with two integers.
response = client([1], 5)
The service call requires two integer arguments. Using a literal integer like 3 is correct.
Fill both blanks to import the service type and initialize the ROS node.
from [1].srv import AddTwoInts rospy.[2]('add_two_ints_client')
You import the service type from your package (e.g., beginner_tutorials) and initialize the node with rospy.init_node.
Fill all three blanks to create a complete service client call and print the result.
rospy.wait_for_service('[1]') client = ServiceProxy('[2]', AddTwoInts) response = client([3], 7) print(f"Sum is: {response.sum}")
You wait for the service /add_two_ints, create the client for the same service, call it with 5 and 7, then print the sum.
