Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

WalkToTargetMachine.h

Go to the documentation of this file.
00001 //-*-c++-*-
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 //! a state machine for walking towards a visual target
00011 class WalkToTargetMachine : public StateNode {
00012 public:
00013   //!constructor, pass parent, success and failure nodes, and VisionSourceID_t
00014   WalkToTargetMachine(VisionEventNS::VisionSourceID_t obj,StateNode* c=NULL, StateNode* l=NULL,StateNode* p=NULL)
00015     : StateNode("WalkToTarget",p),tracking(obj),timeout(NULL),close(c),lost(l),
00016       walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
00017   {}
00018   
00019   void setup();
00020 
00021   virtual void DoStart();
00022   virtual void DoStop();
00023 
00024   static std::string getClassDescription() { return "INCOMPLETE: walks towards a visual target until it gets \"close\""; }
00025 
00026   //uses head to watch ball, walks towards it
00027   virtual void processEvent(const EventBase&);
00028   
00029 
00030 protected:
00031   VisionEventNS::VisionSourceID_t tracking; //!< the object being tracked
00032   TimeOutTrans* timeout; //!< transition in case we lose the ball
00033   StateNode* close; //!< dest if we get close to the object
00034   StateNode* lost; //!< dest if we get lost
00035   MotionManager::MC_ID walker_id; //!< so we can walk
00036   MotionManager::MC_ID headpointer_id; //!< so we can point the head at the object
00037 
00038 private:
00039   WalkToTargetMachine(const WalkToTargetMachine&); //!< don't call this
00040   WalkToTargetMachine operator=(const WalkToTargetMachine&); //!< don't call this
00041 };
00042 
00043 /*! @file
00044  * @brief Describes WalkToTargetMachine, a state machine for walking towards a visual target
00045  * @author ejt (Creator)
00046  *
00047  * $Author: ejt $
00048  * $Name: tekkotsu-1_4_1 $
00049  * $Revision: 1.3 $
00050  * $State: Exp $
00051  * $Date: 2003/06/05 17:03:15 $
00052  */
00053 
00054 #endif

Tekkotsu v1.4
Generated Sat Jul 19 00:06:32 2003 by Doxygen 1.3.2