Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
DriveMeBehavior.hGo to the documentation of this file.00001 //-*-c++-*- 00002 #ifndef INCLUDED_DriveMeBehavior_h_ 00003 #define INCLUDED_DriveMeBehavior_h_ 00004 00005 #include "Behaviors/BehaviorBase.h" 00006 #include "Motion/MotionManager.h" 00007 #include "Motion/MotionSequenceMC.h" 00008 #include "Shared/SharedObject.h" 00009 00010 //! A very simple behavior that asks the user for WalkMC walking parameters and a walk duration. 00011 /*! The AIBO walks accordingly and then stands up, then asks again. And so on and so on.\n 00012 * Input is from cin, not the tekkotsu console (sout) */ 00013 class DriveMeBehavior : public BehaviorBase { 00014 public: 00015 DriveMeBehavior(); //!< constructor 00016 virtual ~DriveMeBehavior() {} //!< destructor 00017 00018 virtual void DoStart(); 00019 virtual void DoStop(); 00020 00021 virtual void processEvent(const EventBase& event); 00022 00023 virtual std::string getName() const { return "DriveMeBehavior"; } 00024 static std::string getClassDescription() { return "Prompts for walk parameters and duration on system console (blocking read), and then executes, repeat until deactivation"; } 00025 00026 protected: 00027 MotionManager::MC_ID walker_id; //!< walks 00028 MotionManager::MC_ID stand_id; //!< stands up first 00029 SharedObject< MotionSequenceMC<MotionSequence::SizeSmall> > stand; //!< for standing 00030 00031 double last_dx; //!< the last dx received 00032 double last_dy; //!< the last dy received 00033 double last_da; //!< the last da received 00034 unsigned int last_time; //!< timestamp of last parameter set 00035 }; 00036 00037 /*! @file 00038 * @brief Describes DriveMeBehavior, a very simple behavior that asks the user for WalkMC walking parameters and a walk duration. 00039 * @author tss (Creator) 00040 * 00041 * $Author: ejt $ 00042 * $Name: tekkotsu-2_2 $ 00043 * $Revision: 1.5 $ 00044 * $State: Rel $ 00045 * $Date: 2003/07/25 20:18:05 $ 00046 */ 00047 00048 #endif |
Tekkotsu v2.2 |
Generated Tue Oct 19 14:19:13 2004 by Doxygen 1.3.9.1 |