Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

LocomotionEvent Class Reference

Gives updates regarding the current movement of the robot through the world. More...

#include <LocomotionEvent.h>

Inheritance diagram for LocomotionEvent:

Detailed Description

Gives updates regarding the current movement of the robot through the world.

An activate event will be sent when a potential source of motion is created, and a deactivate when it is destroyed. Status events will be sent at any change of direction/speed.

The source ID field will hold the MotionManager::MC_ID of the sending MotionCommand

Definition at line 15 of file LocomotionEvent.h.

List of all members.

Public Member Functions

virtual unsigned int getClassTypeID () const
 All subclasses should override this and return a unique ID for their class.
LocomotionEventsetXYA (float X, float Y, float A)
 Allows you to set the new X, Y, and A components.
virtual std::string getDescription (bool showTypeSpecific=true, unsigned int verbosity=0) const
 generates a description of the event with variable verbosity
virtual unsigned int getBinSize () const
 should return the minimum size needed if using binary format (i.e. not XML)
virtual unsigned int loadBinaryBuffer (const char buf[], unsigned int len)
 load from binary format
virtual unsigned int saveBinaryBuffer (char buf[], unsigned int len) const
 save to binary format
virtual void loadXML (xmlNode *node)
 load from XML format
virtual void saveXML (xmlNode *node) const
 Returns true if this event indicates motion has stopped (x,y,a are all essentially zero; may not be exactly zero in Mirage).
virtual bool isStop () const
Constructors

 LocomotionEvent ()
 constructor
 LocomotionEvent (EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur=0)
 constructor
 LocomotionEvent (EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur, const std::string &n, float mag)
 constructor
virtual EventBaseclone () const
 constructor

Public Attributes

float x
 the new x component (body relative)
float y
 the new y component (body relative)
float a
 the new angular component (body relative)

Static Protected Attributes

static const
EventBase::classTypeID_t 
autoRegisterLocomotionEvent = getTypeRegistry().registerType<LocomotionEvent>(makeClassTypeID("LOCO"))
 causes class type id to automatically be registered with EventBase's FamilyFactory (getTypeRegistry())

Constructor & Destructor Documentation

LocomotionEvent::LocomotionEvent (  ) 

constructor

Definition at line 21 of file LocomotionEvent.h.

Referenced by clone().

LocomotionEvent::LocomotionEvent ( EventGeneratorID_t  gid,
size_t  sid,
EventTypeID_t  tid,
unsigned int  dur = 0 
)

constructor

Definition at line 22 of file LocomotionEvent.h.

LocomotionEvent::LocomotionEvent ( EventGeneratorID_t  gid,
size_t  sid,
EventTypeID_t  tid,
unsigned int  dur,
const std::string &  n,
float  mag 
)

constructor

Definition at line 23 of file LocomotionEvent.h.


Member Function Documentation

virtual EventBase* LocomotionEvent::clone (  )  const [virtual]

constructor

Reimplemented from EventBase.

Definition at line 24 of file LocomotionEvent.h.

unsigned int LocomotionEvent::getBinSize (  )  const [virtual]

should return the minimum size needed if using binary format (i.e. not XML)

Reimplemented from EventBase.

Definition at line 20 of file LocomotionEvent.cc.

virtual unsigned int LocomotionEvent::getClassTypeID (  )  const [virtual]

All subclasses should override this and return a unique ID for their class.

All IDs corresponding to all-capital letters are reserved for future framework expansion. (Thus, user subclasses should contain at least one lower-case letter.) This code can be used when serializing to allow quick identification of the class type by the receiver.

Reimplemented from EventBase.

Definition at line 27 of file LocomotionEvent.h.

std::string LocomotionEvent::getDescription ( bool  showTypeSpecific = true,
unsigned int  verbosity = 0 
) const [virtual]

generates a description of the event with variable verbosity

Parameters:
showTypeSpecific should be read by subclasses to add additional information
verbosity can be one of the following values:

  • 0 - Basic: event_name \t generator_id \t source_id \t type_id
  • 1 - Numerics: event_name \t generator_id \t source_id \t type_id
  • 2 - Timing: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp
  • 3 and above - Full: event_name \t generator_id \t source_id \t type_id \t duration \t timestamp \t magnitude if showTypeSpecific, additional fields will be added after the common fields listed above.

Reimplemented from EventBase.

Definition at line 11 of file LocomotionEvent.cc.

virtual bool LocomotionEvent::isStop (  )  const [virtual]

Definition at line 46 of file LocomotionEvent.h.

unsigned int LocomotionEvent::loadBinaryBuffer ( const char  buf[],
unsigned int  len 
) [virtual]

load from binary format

Reimplemented from EventBase.

Definition at line 33 of file LocomotionEvent.cc.

void LocomotionEvent::loadXML ( xmlNode node  )  [virtual]

load from XML format

Reimplemented from EventBase.

Definition at line 55 of file LocomotionEvent.cc.

unsigned int LocomotionEvent::saveBinaryBuffer ( char  buf[],
unsigned int  len 
) const [virtual]

save to binary format

Reimplemented from EventBase.

Definition at line 44 of file LocomotionEvent.cc.

void LocomotionEvent::saveXML ( xmlNode node  )  const [virtual]

Returns true if this event indicates motion has stopped (x,y,a are all essentially zero; may not be exactly zero in Mirage).

Reimplemented from EventBase.

Definition at line 98 of file LocomotionEvent.cc.

LocomotionEvent& LocomotionEvent::setXYA ( float  X,
float  Y,
float  A 
)

Allows you to set the new X, Y, and A components.

Definition at line 30 of file LocomotionEvent.h.

Referenced by XWalkMC::setTargetVelocity(), and XWalkMC::updateOutputsInitial().


Member Data Documentation

const EventBase::classTypeID_t LocomotionEvent::autoRegisterLocomotionEvent = getTypeRegistry().registerType<LocomotionEvent>(makeClassTypeID("LOCO")) [static, protected]

causes class type id to automatically be registered with EventBase's FamilyFactory (getTypeRegistry())

Definition at line 54 of file LocomotionEvent.h.

Referenced by getClassTypeID().


The documentation for this class was generated from the following files:

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:12 2016 by Doxygen 1.6.3