How do I kill an ActionServerWrapper in rospy?

asked 2020-10-08 20:14:25 -0600

Matball gravatar image

Context: I'm writing a node that, upon receiving the path to a JSON file on disk which defines all states and edges, constructs a smach state machine from it and runs that in an smach_ros.ActionServerWrapper (mainly to support preemption of the state machine during execution). When a new JSON filepath is received by this node, it should kill the previous ActionServerWrapper and create a new one based on the new file. However, I'm not sure how to kill said server, and so I'm afraid I'll be creating and running new ActionServerWrappers in parallel every time a new state machine is requested when I only want one at a time.

The smach_ros documentation for ActionServerWrapper doesn't list a method to stop the server, so I'm wondering what might be the accepted best practice to do this. I'm also curious as to why the kinetic/melodic API reference indices don't contain entries for ActionServerWrapper anymore, as I'm using ROS melodic but have to refer to the diamondback reference. Any insight on this is much appreciated.

edit retag flag offensive close merge delete