ros::init_options::NoSigintHandler not used in teleop_turtle_key.cpp
I've just started to learn ROS and I have read that ros::init can handle Sigint.
If I don't want to let ros::init handle SigInt, I have to set it in ros::init options using ros::init_options::NoSigintHandler, but in the code of teleopturtlekey.cpp, they don't use that initialization option. They just do:
void quit(int sig)
{
(void)sig;
tcsetattr(kfd, TCSANOW, &cooked);
ros::shutdown();
exit(0);
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "teleop_turtle");
TeleopTurtle teleop_turtle;
signal(SIGINT,quit);
teleop_turtle.keyLoop();
return(0);
}
They only use signal(SIGINT,quit);
and nothing else.
Is that correct?
Asked by Elric on 2018-12-03 13:07:32 UTC
Comments