Function rclcpp::install_signal_handlers

Function Documentation

bool rclcpp::install_signal_handlers(SignalHandlerOptions signal_handler_options = SignalHandlerOptions::All)

Install the global signal handler for rclcpp.

This function should only need to be run one time per process. It is implicitly run by rclcpp::init(), and therefore this function does not need to be run manually if rclcpp::init() has already been run.

The signal handler will shutdown all initialized context. It will also interrupt any blocking functions in ROS allowing them react to any changes in the state of the system (like shutdown).

This function is thread-safe.

Parameters:

signal_handler_options[in] option to indicate which signal handlers should be installed.

Returns:

true if signal handler was installed by this function, false if already installed.