Complete the code to import the ROS service library.
from [1] import Service
The Service class is imported from rospy to create a service server in ROS.
Complete the code to initialize a ROS node named 'add_two_ints_server'.
rospy.[1]('add_two_ints_server')
start or other incorrect function names.init_node.The function init_node initializes a ROS node with the given name.
Fix the error in the service callback function definition to accept the request parameter.
def handle_add_two_ints([1]):
The service callback function must accept one parameter, commonly named request, which contains the service request data.
Fill both blanks to create a service server named 'add_two_ints' using the 'AddTwoInts' service type and the callback function.
service = rospy.Service('[1]', [2], handle_add_two_ints)
The service server is created with the name add_two_ints and the service type AddTwoInts.
Fill all three blanks to complete the service callback function that returns the sum of two integers from the request.
def handle_add_two_ints(request): sum_result = request.a [1] request.b rospy.loginfo(f"Adding [2] and [3]") return AddTwoIntsResponse(sum_result)
The callback adds request.a and request.b using the plus operator, logs the values, and returns the sum.
