00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __Watchdog_H__
00009 #define __Watchdog_H__
00010
00011 #define WATCHDOG_EXECUTE(module, command) watchdog.enter(module); command; watchdog.leave(module);
00012
00013
00014
00015 class Watchdog
00016 {
00017 public:
00018 enum ModuleID
00019 {
00020 colorTableMod,
00021 sensorDataProcessor,
00022 imageProcessor,
00023 ballLocator,
00024 teamBallLocator,
00025 obstaclesLocator,
00026 playersLocator,
00027 selfLocator,
00028 robotStateDetector,
00029 collisionDetector,
00030 behaviorControl,
00031 motionControl,
00032 walkingEngineNormal,
00033 headControl,
00034 ledControl,
00035 getupEngine,
00036 soundControl,
00037 sensorBehaviorControl,
00038 gtCam,
00039 numOfModules,
00040 teamcommDDPReceive = 1000,
00041 teamcommUDPReceive = 1001,
00042 teamcommProgress = 1002,
00043 teamcommSend = 1003
00044
00045 };
00046
00047 Watchdog();
00048 void enter(int i);
00049 void leave(int i);
00050 void dump();
00051
00052 private:
00053 enum { stackSize=100};
00054 int stack[stackSize];
00055 int top;
00056 unsigned long lastDump;
00057 int operations;
00058
00059 };
00060
00061 extern Watchdog watchdog;
00062
00063 #endif