Homepage Demos Overview Downloads Tutorials Reference
Credits

StareAtBallBehavior.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_StareAtBallBehavior_h_
00003 #define INCLUDED_StareAtBallBehavior_h_
00004 
00005 #include "Behaviors/BehaviorBase.h"
00006 #include "Motion/MotionManager.h"
00007 
00008 //! A simple behavior to chase after any objects seen by the vision system
00009 class StareAtBallBehavior : public BehaviorBase {
00010 public:
00011   //!constructor
00012   StareAtBallBehavior()
00013     : BehaviorBase(), headpointer_id(MotionManager::invalid_MC_ID)
00014   {}
00015   //!destructor
00016   virtual ~StareAtBallBehavior() {}
00017 
00018   //! adds a headpointer and a listens for vision events
00019   virtual void DoStart();
00020 
00021   //! removes motion commands and stops listening
00022   virtual void DoStop();
00023 
00024   //! sets the head to point at the object and sets the body to move where the head points
00025   virtual void processEvent(const EventBase& event);
00026       
00027   virtual std::string getName() const { return "StareAtBallBehavior"; }
00028   static std::string getClassDescription() { return "Tracks any objects seen by the vision system"; }
00029 
00030 protected:
00031   MotionManager::MC_ID headpointer_id; //!< a HeadPointerMC object
00032 };
00033 
00034 /*! @file
00035  * @brief Describes StareAtBallBehavior, which runs around after whatever the dog sees
00036  * @author tss (Creator)
00037  *
00038  * $Author: ejt $
00039  * $Name: tekkotsu-2_0 $
00040  * $Revision: 1.4 $
00041  * $State: Rel $
00042  * $Date: 2003/09/25 15:26:23 $
00043  */
00044 
00045 #endif

Tekkotsu v2.0
Generated Wed Jan 21 03:20:30 2004 by Doxygen 1.3.4