Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

WalkToTargetNode.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_WalkToTargetNode_h_
00003 #define INCLUDED_WalkToTargetNode_h_
00004 
00005 #include "Behaviors/StateNode.h"
00006 #include "Motion/MotionManager.h"
00007 
00008 //! a state node for walking towards a visual target
00009 class WalkToTargetNode : public StateNode {
00010 public:
00011   //!constructor, pass VisionObjectSourceID_t
00012   WalkToTargetNode(unsigned int obj)
00013     : StateNode(),tracking(obj),
00014       walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
00015   {}
00016   
00017   //!constructor, pass instance name and VisionObjectSourceID_t
00018   WalkToTargetNode(const std::string& nodename, unsigned int obj)
00019     : StateNode(nodename),tracking(obj),
00020       walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
00021   {}
00022   
00023   static std::string getClassDescription() { return "walks towards a visual target, using some basic logic for moving the head to track it"; }
00024   virtual std::string getDescription() const { return getClassDescription(); }
00025 
00026   virtual Transition* newDefaultLostTrans(StateNode* dest);  //!< returns a suggested transition for detecting "lost" condition, but you don't have to use it
00027   virtual Transition* newDefaultCloseTrans(StateNode* dest); //!< returns a suggested transition for detecting "close to target" condition, but you don't have to use it
00028 
00029 protected:
00030   virtual void doStart();
00031   virtual void doStop();
00032   //! uses head to watch ball, walks towards it
00033   virtual void doEvent();
00034   
00035   unsigned int tracking; //!< the object being tracked
00036   MotionManager::MC_ID walker_id; //!< so we can walk
00037   MotionManager::MC_ID headpointer_id; //!< so we can point the head at the object
00038 
00039 private:
00040   WalkToTargetNode(const WalkToTargetNode&); //!< don't call this
00041   WalkToTargetNode operator=(const WalkToTargetNode&); //!< don't call this
00042 };
00043 
00044 /*! @file
00045  * @brief Describes WalkToTargetNode, a state node for walking towards a visual target
00046  * @author ejt (Creator)
00047  */
00048 
00049 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:52 2016 by Doxygen 1.6.3