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
Next revisionBoth sides next revision
getting_started:practical_problems:abort [2017/09/25 07:43] grafgetting_started:practical_problems:abort [2017/11/05 13:32] – [Define Signal Handler when using ROS] graf
Line 40: Line 40:
 }); });
 </code> </code>
-This will cause the executor to stop running and return control to the main programm which in turns will exit.+This will cause the executor to stop running and return control to the main programm. Further, any running sequences will terminate and the main program will exit. 
 + 
 +===== Define Signal Handler when using ROS ===== 
 +If you use ROS you have to keep in mind to register the signal handler only after the  
 +<code cpp> 
 +#include "MySafetyProperties.hpp> 
 +#include <signal.h> 
 + 
 +void signalHandler(int signum) { 
 +  SafetySystem::exitHandler(); 
 +
 + 
 +int main() { 
 +  signal(SIGINT, signalHandler); 
 + 
 +  ... 
 +   
 +  // Create and initialize safety system 
 +  double period = 1; 
 +  MySafetyProperties ssProperties; 
 +  SafetySystem safetySys(ssProperties, period); 
 +  
 +  ...  
 +
 +</code>
getting_started/practical_problems/abort.txt · Last modified: 2024/02/16 08:16 by ursgraf