# Revision history [back]

You could register a hook with rospy.on_shutdown() as described here. Note that, as described, messages aren't guaranteed to be published.

If you need more fancy handling, have a look at the Advanced Example on the same page.

You could register a hook with rospy.on_shutdown() as described here. , that sets the motor values to zero. Note that, as described, messages aren't guaranteed to be published.

If you need more fancy handling, have a look at the Advanced Example on the same page.

Also, note that if your node crashes for some reason, this will not be called.