Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

LocomotionEvent.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_LocomotionEvent_h_
00003 #define INCLUDED_LocomotionEvent_h_
00004 
00005 #include "EventBase.h"
00006 #include <iostream>
00007 
00008 //! Gives updates regarding the current movement of the robot through the world
00009 /*! An activate event will be sent when a potential source of motion is created,
00010  *  and a deactivate when it is destroyed.  Status events will be sent at any
00011  *  change of direction/speed.
00012  *
00013  *  The source ID field will hold the MotionManager::MC_ID of the sending MotionCommand
00014  */
00015 class LocomotionEvent : public EventBase {
00016  public:
00017 
00018   //! @name Constructors
00019 
00020   //! constructor
00021   LocomotionEvent() : EventBase(),x(0),y(0),a(0) {}
00022   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) {}
00023   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) {}
00024   virtual EventBase* clone() const { return new LocomotionEvent(*this); }
00025   //@}
00026 
00027   virtual unsigned int getClassTypeID() const { return makeClassTypeID("LOCO"); }
00028 
00029   //! Allows you to set the new X, Y, and A components
00030   LocomotionEvent& setXYA(float X, float Y, float A) {
00031     x=X;
00032     y=Y;
00033     a=A;
00034     return *this;
00035   }
00036 
00037   virtual std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const;
00038 
00039   virtual unsigned int getBinSize() const;
00040   virtual unsigned int LoadBinaryBuffer(const char buf[], unsigned int len);
00041   virtual unsigned int SaveBinaryBuffer(char buf[], unsigned int len) const;
00042   virtual void LoadXML(xmlNode* node);
00043   virtual void SaveXML(xmlNode * node) const;
00044 
00045   float x; //!< the new x component (body relative)
00046   float y; //!< the new y component (body relative)
00047   float a; //!< the new angular component (body relative)
00048 };
00049 
00050 /*! @file
00051  * @brief Describes LocomotionEvent, which gives updates regarding the current movement of the robot through the world
00052  * @author ejt (Creator)
00053  *
00054  * $Author: ejt $
00055  * $Name: tekkotsu-2_4_1 $
00056  * $Revision: 1.8 $
00057  * $State: Exp $
00058  * $Date: 2005/06/29 22:03:35 $
00059  */
00060 
00061 #endif

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