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("WalkToTargetNode","WalkToTarget"),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("WalkToTargetNode",nodename),tracking(obj),
00020       walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
00021   {}
00022   
00023   virtual void DoStart();
00024   virtual void DoStop();
00025 
00026   static std::string getClassDescription() { return "walks towards a visual target, using some basic logic for moving the head to track it"; }
00027   virtual std::string getDescription() const { return getClassDescription(); }
00028 
00029   //! uses head to watch ball, walks towards it
00030   virtual void processEvent(const EventBase& event);
00031   
00032   virtual Transition* newDefaultLostTrans(StateNode* dest);  //!< returns a suggested transition for detecting "lost" condition, but you don't have to use it
00033   virtual Transition* newDefaultCloseTrans(StateNode* dest); //!< returns a suggested transition for detecting "close to target" condition, but you don't have to use it
00034 
00035 
00036 protected:
00037   //!constructor, pass class name, instance name, and VisionObjectSourceID_t
00038   WalkToTargetNode(const std::string& classname, const std::string& nodename, unsigned int obj)
00039     : StateNode(classname,nodename),tracking(obj),
00040       walker_id(MotionManager::invalid_MC_ID), headpointer_id(MotionManager::invalid_MC_ID) 
00041   {}
00042   
00043   unsigned int tracking; //!< the object being tracked
00044   MotionManager::MC_ID walker_id; //!< so we can walk
00045   MotionManager::MC_ID headpointer_id; //!< so we can point the head at the object
00046 
00047 private:
00048   WalkToTargetNode(const WalkToTargetNode&); //!< don't call this
00049   WalkToTargetNode operator=(const WalkToTargetNode&); //!< don't call this
00050 };
00051 
00052 /*! @file
00053  * @brief Describes WalkToTargetNode, a state node for walking towards a visual target
00054  * @author ejt (Creator)
00055  *
00056  * $Author: ejt $
00057  * $Name: tekkotsu-4_0 $
00058  * $Revision: 1.5 $
00059  * $State: Exp $
00060  * $Date: 2005/12/15 18:51:27 $
00061  */
00062 
00063 #endif

Tekkotsu v4.0
Generated Thu Nov 22 00:54:56 2007 by Doxygen 1.5.4