User Tools

Site Tools


getting_started:practical_problems:abort

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
getting_started:practical_problems:abort [2017/11/05 13:31] – [Define Signal Handler when using ROS] grafgetting_started:practical_problems:abort [2024/02/16 08:15] ursgraf
Line 1: Line 1:
-====== Shutting down a System ======+====== Shutting down a System Properly ======
 How does a robot control system properly shut down? In general it does never stop. Pressing an emergency button might switch to a emergency safety level. From there it might restart again after certain steps are taken. \\ However, in a system under development it is often desirable to end an application. That usually means to switch to a specific safety level where the necessary steps for a well controlled stopping of the application takes place. Only after this happened the executor stops running and returns control to the main program, which then stops as well. \\ How does a robot control system properly shut down? In general it does never stop. Pressing an emergency button might switch to a emergency safety level. From there it might restart again after certain steps are taken. \\ However, in a system under development it is often desirable to end an application. That usually means to switch to a specific safety level where the necessary steps for a well controlled stopping of the application takes place. Only after this happened the executor stops running and returns control to the main program, which then stops as well. \\
-The following example shows how this can be accomplished. The code can be found in [[getting_started:tutorials:safetysystem|]]. First of all you have to define a signal handler which handles all kind of signals, among them the ''SIGINT'' signal which is sent by pressing ''Ctrl-C''.+The following example shows how this can be accomplished. The code can be found in [[getting_started:tutorials:system2|]]. First of all you have to define a signal handler which handles all kind of signals, among them the ''SIGINT'' signal which is sent by pressing ''Ctrl-C''.
 <code cpp> <code cpp>
 #include "MySafetyProperties.hpp> #include "MySafetyProperties.hpp>
Line 43: Line 43:
  
 ===== Define Signal Handler when using ROS ===== ===== Define Signal Handler when using ROS =====
-If you use ROS you have to keep in mind to define the +If you use ROS you have to keep in mind to register the signal handler only after the ROS node is created and initialized, otherwise the registration will be overwritten by ROS. 
 +<code cpp> 
 + 
 +int main() { 
 +  ... 
 +  // init ROS node 
 +   
 +  signal(SIGINT, signalHandler); 
 +  ... 
 +
 +</code>
getting_started/practical_problems/abort.txt · Last modified: 2024/02/16 08:16 by ursgraf