Project

General

Profile

Revision dcf49526

IDdcf49526269a0df9a064ad37dfff13efdea10d97

Added by Priya about 11 years ago

Overwrote the ROS sigint handler so now behaviours stop and die and stop motors upon exiting.

View differences:

scout/libscout/src/Behavior.h
39 39

  
40 40
#include <ros/ros.h>
41 41
#include <std_msgs/String.h>
42
#include <iostream>
42 43

  
43 44
#include "MotorControl.h"
44 45
#include "HeadlightControl.h"
......
70 71

  
71 72
        // Name of behaviour
72 73
        std::string name;
74

  
75
        // Flag to check if sigint recieved.
76
        static bool keep_running;
73 77
        
74 78
    protected:
75 79
        ros::NodeHandle node;
......
91 95
        void default_callback(std::vector<uint8_t> data);
92 96

  
93 97
        // Wrappers for ROS functions
94
        bool ok();
95
        void spin();
96
        void spinOnce();
98
        static bool ok();
99
        static void spin();
100
        static void spinOnce();
97 101
};
98 102

  
99 103
#endif

Also available in: Unified diff