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","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 virtual std::string getDescription() const { return getClassDescription(); }
00028
00029
00030 virtual void processEvent(const EventBase& event);
00031
00032 virtual Transition* getLostTrans() { return timeout; }
00033 virtual Transition* getCloseTrans() { return closeTrans; }
00034
00035
00036 protected:
00037 unsigned int tracking;
00038 TimeOutTrans* timeout;
00039 Transition* closeTrans;
00040 StateNode* close;
00041 StateNode* lost;
00042 MotionManager::MC_ID walker_id;
00043 MotionManager::MC_ID headpointer_id;
00044
00045 private:
00046 WalkToTargetMachine(const WalkToTargetMachine&);
00047 WalkToTargetMachine operator=(const WalkToTargetMachine&);
00048 };
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #endif