Homepage Demos Overview Downloads Tutorials Reference
Credits

LocomotionEvent.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_LocomotionEvent_h_
00002 #define INCLUDED_LocomotionEvent_h_
00003 
00004 #include "EventBase.h"
00005 
00006 //! Gives updates regarding the current movement of the robot through the world
00007 /*! An activate event will be sent when a potential source of motion is created,
00008  *  and a deactivate when it is destroyed.  Status events will be sent at any
00009  *  change of direction/speed.
00010  *
00011  *  The source ID field will hold the MotionManager::MC_ID of the sending MotionCommand
00012  */
00013 class LocomotionEvent : public EventBase {
00014  public:
00015 
00016   //! @name Constructors
00017 
00018   //! constructor
00019   LocomotionEvent() : EventBase(),x(0),y(0),a(0) {}
00020   LocomotionEvent(EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur=0) : EventBase(gid,sid,tid,dur),x(0),y(0),a(0) {}
00021   LocomotionEvent(EventGeneratorID_t gid, unsigned int sid, EventTypeID_t tid, unsigned int dur, const std::string& n, float mag) : EventBase(gid,sid,tid,dur,n,mag),x(0),y(0),a(0) {}
00022   //@}
00023 
00024   //! Allows you to set the new X, Y, and A components
00025   LocomotionEvent& setXYA(float X, float Y, float A) {
00026     x=X;
00027     y=Y;
00028     a=A;
00029     return *this;
00030   }
00031 
00032   virtual std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const;
00033 
00034   virtual unsigned int getBinSize() const;
00035   virtual unsigned int LoadBuffer(const char buf[], unsigned int len);
00036   virtual unsigned int SaveBuffer(char buf[], unsigned int len) const;
00037 
00038   float x; //!< the new x component (body relative)
00039   float y; //!< the new y component (body relative)
00040   float a; //!< the new angular component (body relative)
00041 };
00042 
00043 /*! @file
00044  * @brief Describes LocomotionEvent, which gives updates regarding the current movement of the robot through the world
00045  * @author ejt (Creator)
00046  *
00047  * $Author: ejt $
00048  * $Name: tekkotsu-2_2_2 $
00049  * $Revision: 1.6 $
00050  * $State: Exp $
00051  * $Date: 2004/09/01 21:30:57 $
00052  */
00053 
00054 #endif

Tekkotsu v2.2.2
Generated Tue Jan 4 15:43:14 2005 by Doxygen 1.4.0