Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ExploreMachine.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ExploreMachine_h_
00003 #define INCLUDED_ExploreMachine_h_
00004 
00005 #include "Behaviors/StateNode.h"
00006 #include "Motion/MotionManager.h"
00007 
00008 //! A state machine for exploring an environment (or searching for an object)
00009 class ExploreMachine : public StateNode {
00010 public:
00011   //!constructor
00012   ExploreMachine()
00013     : StateNode("ExploreMachine","ExploreMachine"), start(NULL), turn(NULL), walkid(MotionManager::invalid_MC_ID)
00014   {}
00015 
00016   //!constructor
00017   ExploreMachine(const std::string& nm)
00018     : StateNode("ExploreMachine",nm), start(NULL), turn(NULL), walkid(MotionManager::invalid_MC_ID)
00019   {}
00020 
00021   //!destructor, check if we need to call our teardown
00022   ~ExploreMachine() {
00023     if(issetup)
00024       teardown();
00025   }
00026 
00027   virtual void setup();
00028   virtual void DoStart();
00029   virtual void DoStop();
00030   virtual void teardown();
00031 
00032   //! called each time the turn node is activated, sets a new random turn direction and speed
00033   virtual void processEvent(const EventBase& /*e*/);
00034 
00035 protected:
00036   StateNode * start; //!< the node to begin within on DoStart() (turn)
00037   class WalkNode * turn; //!< walk node to use when turning
00038   MotionManager::MC_ID walkid; //!< we want to share a walk between turning and walking nodes
00039 
00040 private:
00041   ExploreMachine(const ExploreMachine&); //!< don't use
00042   ExploreMachine operator=(const ExploreMachine&); //!< don't use
00043 };
00044 
00045 /*! @file
00046  * @brief Describes ExploreMachine, a state machine for exploring an environment (or searching for an object)
00047  * @author ejt (Creator)
00048  *
00049  * $Author: ejt $
00050  * $Name: tekkotsu-2_4_1 $
00051  * $Revision: 1.23 $
00052  * $State: Exp $
00053  * $Date: 2005/01/24 22:23:46 $
00054  */
00055 
00056 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:47 2005 by Doxygen 1.4.4