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

Revision history [back]

my_action_server_wrapper.run_server() is a non-blocking call that starts the server (including a background thread, which is why your program isn't exiting). If you'd like to be able to ctrl-c your program, then you need something to wait in the main thread, handle the signal, and then signal rospy to shutdown.

Just add the following after your call to my_action_server_wrapper.run_server():

rospy.spin()

This will block until you ctrl-c your program, at which point it will call rospy.signal_shutdown(). For more on this, see the rospy documentation on Initialization and Shutdown.