ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ros is already handling SIGINT. If you override that handler, then you are responsible for shutting down the ros node.

In general in roscpp, you should be polling ros::ok() to determine when ros node shutdown has been requested, rather than grabbing SIGINT yourself. There are other mechanisms (e.g. rosnode kill) to request shutdown that do not use a signal.

ros is already handling SIGINT. If you override that handler, then you are responsible for shutting down the ros node.

In general in roscpp, you should be polling ros::ok() to determine when ros node shutdown has been requested, rather than grabbing SIGINT yourself. There are other mechanisms (e.g. rosnode kill) to request shutdown that do not use a signal.

Also, there is no way for you to "make sure your thread is terminated first." In a ros-like system, you have no control over when a connection goes down or when a different linux process exits.