Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ros automatically installs a signal handler in the common ros loop (you can disable that in ros::init afaik). The default is SIGINT, which corresponds to pressing Ctrl-C on the keyboard.

SIGTERM is the corresponding signal that is send to the application when you kill it from the command line. I think ros (roslaunch) kills an application as first using SIGINT (nicely) and if the program doesn't react to "escalate" to SIGTERM (killing it).

So probably your program doesn't quit on SIGINT, which might be because of your signal handler. If you only use it to catch Ctrl-C, you can just use while(ros::ok()) ... in your main loop and remove all signal handling on your side. Otherwise you should quit on Ctrl-C (or just accept that it "escalates").

ros ROS automatically installs a signal handler in for the common ros loop application (you can disable that in ros::init afaik). afaik) that can be used in the main loop. The default is SIGINT, which corresponds to pressing Ctrl-C on the keyboard.

SIGTERM is the corresponding signal that is send to the application when you kill it from the command line. I think ros (roslaunch) kills an application as first using SIGINT (nicely) and if the program doesn't react to "escalate" to SIGTERM (killing it).

So probably your program doesn't quit on SIGINT, which might be because of your signal handler. If you only use it to catch Ctrl-C, you can just use while(ros::ok()) ... in your main loop and remove all signal handling on your side. Otherwise you should quit on Ctrl-C (or just accept that it "escalates").

ROS automatically installs a signal handler for the application (you can disable that in ros::init afaik) that can be used in the main loop. The default is SIGINT, which corresponds to pressing Ctrl-C on the keyboard.

SIGTERM is the corresponding signal that is send sent to the application when you kill it from the command line. I think ros (roslaunch) kills an application as first using SIGINT (nicely) and if the program doesn't react to "escalate" to SIGTERM (killing it).

So probably your program doesn't quit on SIGINT, which might be because of your signal handler. If you only use it to catch Ctrl-C, you can just use while(ros::ok()) ... in your main loop and remove all signal handling on your side. Otherwise you should quit on Ctrl-C (or just accept that it "escalates").

ROS automatically installs a signal handler for the application (you can disable that in ros::init afaik) that can be used in the main loop. The default is SIGINT, which corresponds to pressing Ctrl-C on the keyboard.

SIGTERM is the corresponding signal that is sent to the application when you kill it from the command line. I think ros (roslaunch) kills an application as first using SIGINT (nicely) and if the program doesn't react to "escalate" to SIGTERM (killing it).it - by asking). I'm not sure if SIGKILL is used, that would kill the application immediately.

So probably your program doesn't quit on SIGINT, which might be because of your signal handler. If you only use it to catch Ctrl-C, you can just use while(ros::ok()) ... in your main loop and remove all signal handling on your side. Otherwise you should quit on Ctrl-C (or just accept that it "escalates").