Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

DriveMeBehavior.h

Go 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 "IPC/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   static std::string getClassDescription() { return "Prompts for walk parameters and duration on system console (blocking read), and then executes, repeat until deactivation"; }
00024   virtual std::string getDescription() const { return getClassDescription(); }
00025 
00026 protected:
00027   MotionManager::MC_ID walker_id; //!< walks
00028   MotionManager::MC_ID stand_id;  //!< stands up first
00029   SharedObject<SmallMotionSequenceMC> 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_4_1 $
00043  * $Revision: 1.8 $
00044  * $State: Exp $
00045  * $Date: 2005/06/01 05:47:45 $
00046  */
00047 
00048 #endif

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