00001
00002 #ifndef INCLUDED_WalkToTargetMachine_h_
00003 #define INCLUDED_WalkToTargetMachine_h_
00004
00005 #include "Behaviors/StateNode.h"
00006 #include "Behaviors/Transitions/TimeOutTrans.h"
00007 #include "Behaviors/Transitions/VisualTargetCloseTrans.h"
00008 #include "Motion/MotionManager.h"
00009
00010
00011 class WalkToTargetMachine : public StateNode {
00012 public:
00013
00014 WalkToTargetMachine(unsigned int obj,StateNode* c=NULL, StateNode* l=NULL,StateNode* p=NULL)
00015 : StateNode("WalkToTarget",p),tracking(obj),timeout(NULL),closeTrans(NULL),close(c),lost(l),
00016 walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID)
00017 {}
00018
00019 virtual void setup();
00020
00021 virtual void DoStart();
00022 virtual void DoStop();
00023
00024 virtual void teardown();
00025
00026 static std::string getClassDescription() { return "walks towards a visual target until it gets \"close\""; }
00027
00028
00029 virtual void processEvent(const EventBase& event);
00030
00031 virtual Transition* getLostTrans() { return timeout; }
00032 virtual Transition* getCloseTrans() { return closeTrans; }
00033
00034
00035 protected:
00036 unsigned int tracking;
00037 TimeOutTrans* timeout;
00038 Transition* closeTrans;
00039 StateNode* close;
00040 StateNode* lost;
00041 MotionManager::MC_ID walker_id;
00042 MotionManager::MC_ID headpointer_id;
00043
00044 private:
00045 WalkToTargetMachine(const WalkToTargetMachine&);
00046 WalkToTargetMachine operator=(const WalkToTargetMachine&);
00047 };
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #endif