does ros::ok return false if ros::init_options::NoSigintHandler
does ros::ok
always returns false irrespective of if signal handler is installed or not.? If I use ros::init_options::NoSigintHandler
and use boost::asio::io_service io_service
, how do I make sure that my node is terminated without escalating to SIGTERM
.
It never reaches to handler.
int main( int argc , char** argv )
{
ros::init(argc, argv, "name", ros::init_options::NoSigintHandler);
boost::asio::io_service io_service; // Construct a signal set registered for process termination.
boost::asio::signal_set signals(io_service, SIGINT );
signals.async_wait(
&io_service
{
ROS_ERROR("inside signal handler");
io_service.stop();
});
boost::asio::spawn(io_service, {
while(1);
}
);
io_service.run();
return 0;
}
Can we get a bit more context? Maybe a (minimal) code sample that we can reproduce this with?
@allenh1 added.