Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
ChaseBallBehavior.hGo to the documentation of this file.00001 //-*-c++-*- 00002 #ifndef INCLUDED_ChaseBallBehavior_h_ 00003 #define INCLUDED_ChaseBallBehavior_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 ChaseBallBehavior : public BehaviorBase { 00010 public: 00011 //!constructor 00012 ChaseBallBehavior() 00013 : BehaviorBase("ChaseBallBehavior"), headpointer_id(MotionManager::invalid_MC_ID), walker_id(MotionManager::invalid_MC_ID) 00014 {} 00015 //!destructor 00016 virtual ~ChaseBallBehavior() {} 00017 00018 //! adds a headpointer and a walker, 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 static std::string getClassDescription() { return "Follows ball with head and walks whereever the head is pointing"; } 00028 virtual std::string getDescription() const { return getClassDescription(); } 00029 00030 protected: 00031 MotionManager::MC_ID headpointer_id; //!< a HeadPointerMC object 00032 MotionManager::MC_ID walker_id; //!< a WalkMC object 00033 }; 00034 00035 /*! @file 00036 * @brief Describes ChaseBallBehavior, which runs around after whatever the dog sees 00037 * @author ejt (Creator) 00038 * 00039 * $Author: ejt $ 00040 * $Name: tekkotsu-2_2_2 $ 00041 * $Revision: 1.5 $ 00042 * $State: Exp $ 00043 * $Date: 2004/11/11 01:45:35 $ 00044 */ 00045 00046 #endif |
Tekkotsu v2.2.2 |
Generated Tue Jan 4 15:43:13 2005 by Doxygen 1.4.0 |