You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try:
rclpy.spin(led_strip.node)
except (KeyboardInterrupt, rclpy.executors.ExternalShutdownException):
// context is already gone at this point
pass
finally:
rclpy.try_shutdown()
Implementation considerations
rclpy has an on_shutdown` hook in but that comes too late (i.e. after shutdown).
rclcpp has a pre_shutdown hook: ros2/rclcpp#1714 but this is not available in rclpy.
The text was updated successfully, but these errors were encountered:
Feature request
Feature description
Hooks that run immediately prior to shutdown. It used to be possible prior to humble with:
It looks like this is no longer possible since context shutdowns happen automagically.
Typical humble code now looks like:
Implementation considerations
rclpy has an
on_shutdown` hook in but that comes too late (i.e. after shutdown).rclcpp
has apre_shutdown
hook: ros2/rclcpp#1714 but this is not available inrclpy
.The text was updated successfully, but these errors were encountered: