Complete the code to import the ROS action server library.
from actionlib import [1]
The SimpleActionServer class is used to create an action server in ROS.
Complete the code to initialize the ROS node for the action server.
import rospy rospy.[1]('my_action_server')
The init_node function initializes a ROS node with the given name.
Fix the error in the action server callback function definition.
def execute_cb([1]): rospy.loginfo('Executing action')
The callback function for the action server receives the goal as its argument.
Fill both blanks to create the action server instance and start it.
server = SimpleActionServer('[1]', MyAction, execute_cb=[2], auto_start=False) server.start()
The first blank is the action name string. The second blank is the callback function name.
Fill all three blanks to send a success result from the action server.
result = MyActionResult() result.[1] = True server.[2](result) rospy.loginfo('[3]')
The result's success field is set to True, then set_succeeded sends the result, and a log message confirms success.
