smach_ros.util module

smach_ros.util.set_preempt_handler(sc)

Sets a ROS pre-shutdown handler to preempt a given SMACH container when ROS receives a shutdown request.

This can be attached to multiple containers, but only needs to be used on the top-level containers.

@type sc: L{smach.Container} @param sc: Container to preempt on ROS shutdown.