jrl-umi3218 / mc_rtc

mc_rtc is an interface for simulated and real robotic systems suitable for real-time control
BSD 2-Clause "Simplified" License
122 stars 37 forks source link

[ROS] Restore ROS Signal Handler #302

Closed arntanguy closed 2 years ago

arntanguy commented 2 years ago

Currently ROS is initialized with:

  ros::init(argc, argv, name.c_str(), ros::init_options::NoSigintHandler);

This means that interrupt signals (Ctrl-C) will not be caught by ROS itself, and thus that code execution will be interrupted immediately. In particular:

while(ros::ok())
{
  MCGlobalController gc;
}
// destructors will not be called upon Ctrl-C (controllers, plugins, observers, etc)

Since in that case destructors are not called, this can cause issues down the line. I can't think of any reason why we should be disabling the default signal handler, and doing so is confusing.