From 477a14b524f361d0e60ee47d2d07644c668b91f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergi=20Hern=C3=A0ndez=20Juan?= <shernand@iri.upc.edu> Date: Wed, 4 Feb 2015 07:48:15 +0000 Subject: [PATCH] Removed the code to handle the Ctrl+C combination because it was not used and it gave problems in some inherited classes. --- include/iri_base_algorithm/iri_base_algorithm.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/include/iri_base_algorithm/iri_base_algorithm.h b/include/iri_base_algorithm/iri_base_algorithm.h index b41f0a4..492edfe 100644 --- a/include/iri_base_algorithm/iri_base_algorithm.h +++ b/include/iri_base_algorithm/iri_base_algorithm.h @@ -42,17 +42,12 @@ namespace algorithm_base class AbstractAlgorithmNode { protected: - static int ctrl_c_hit_count_; static void hupCalled(int sig) { ROS_WARN("Unexpected SIGHUP caught. Ignoring it."); } - static void sigCalled(int sig) - { - ctrl_c_hit_count_++; - } }; /** @@ -322,7 +317,7 @@ void *IriBaseAlgorithm<Algorithm>::mainThread(void *param) // retrieve base algorithm class IriBaseAlgorithm *iriNode = (IriBaseAlgorithm *)param; - while(ros::ok() && !ctrl_c_hit_count_) + while(ros::ok()) { // run node stuff iriNode->mainNodeThread(); @@ -354,7 +349,7 @@ int IriBaseAlgorithm<Algorithm>::spin(void) // create the status thread pthread_create(&this->thread,NULL,this->mainThread,this); - while(ros::ok() && !ctrl_c_hit_count_) + while(ros::ok()) { // update diagnostics this->diagnostic_.update(); @@ -372,7 +367,6 @@ int IriBaseAlgorithm<Algorithm>::spin(void) } // definition of the static Ctrl+C counter -int AbstractAlgorithmNode::ctrl_c_hit_count_ = 0; /** * \brief base main -- GitLab