Sometimes you need to clean up the task by performing a final step before the node closes. For example, when we have a hardware interface and send move commands to the wheelbase, we need to send 0 velocities after the termination of the spinning while loop to stop the robot. In python and more specifically
Continue reading how to perform a final task before a ROS node shuts down