Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

WalkNode Class Reference

#include <WalkNode.h>

Inheritance diagram for WalkNode:

Inheritance graph
[legend]
List of all members.

Detailed Description

A StateNode for walking in a direction.

Definition at line 13 of file WalkNode.h.

Public Types

enum  WalkMode_t { VelocityWalkMode, DistanceWalkMode }
 lets us interpret values as either distances or velocities More...

Public Member Functions

 WalkNode ()
 constructor
 WalkNode (float xvel, float yvel, float avel)
 constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes velocity
 WalkNode (float xvel, float yvel, float avel, int steps)
 constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes distance
 WalkNode (const std::string &name, float xvel, float yvel, float avel)
 constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes velocity
 WalkNode (const std::string &name, float xvel, float yvel, float avel, int steps)
 constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes distance
 ~WalkNode ()
 destructor, check if we need to call our teardown
void setDisplacement (float xd, float yd, float ad, int np=-1)
 sets the velocity of the walk
void setVelocity (float xvel, float yvel, float avel, int np=-1)
 sets the velocity of the walk
void setXVelocity (float xvel)
 sets the velocity in x direction (positive is forward)
float getXVelocity ()
 returns the velocity in x direction (positive is forward)
void setYVelocity (float yvel)
 sets the velocity in y direction (positive is forward)
float getYVelocity ()
 returns the velocity in y direction (positive is forward)
void setAVelocity (float avel)
 sets the velocity of the turn, positive is counter-clockwise from above (to match coordinate system)
float getAVelocity ()
 returns the velocity of the turn, positive is counter-clockwise from above (to match coordinate system)
virtual void DoStart ()
 Transitions should call this when you are entering the state, so it can enable its transitions.
virtual void DoStop ()
 Transitions should call this when you are leaving the state, so it can disable its transitions.
virtual void processEvent (const EventBase &e)
 receive locomotionEGID status event and throw stateMachineEGID status event, ie a completion event
virtual void teardown ()
 removes walkid if walkidIsMine
virtual void setWalkID (MotionManager::MC_ID id)
 use this to force the WalkNode to use a shared WalkMC - set to MotionManager::invalid_MC_ID to reset to internally generated walk
virtual MotionManager::MC_ID getWalkID ()
 use this to access the WalkMC that the WalkNode is using
virtual bool ownsWalkID ()
 returns true if walkid was created (and will be destroyed) by this WalkNode - false if assigned by setWalkID()

Protected Member Functions

void storeValues (float xp, float yp, float ap, int np, WalkMode_t wmode)
 stores the values and if active, calls updateWMC()
void updateWMC ()
 makes the appropriate calls on the WalkMC

Protected Attributes

MotionManager::MC_ID walkid
 the current WalkMC
bool walkidIsMine
 true if the walk was created in updateWalk (instead of assigned externally)
float x
 velocity in x direction (positive is forward), or distance if walkMode is DistanceWalkMode
float y
 velocity in y direction (positive is dog's left), or distance if walkMode is DistanceWalkMode
float a
 velocity of the turn, positive is counter-clockwise from above (to match coordinate system), or distance if walkMode is DistanceWalkMode
int n
 number of steps (-1 means walk forever)
WalkMode_t walkMode
 the current interpretation of x, y, and a


Member Enumeration Documentation

enum WalkNode::WalkMode_t
 

lets us interpret values as either distances or velocities

Enumerator:
VelocityWalkMode  x, y, a will be interpreted as mm/s
DistanceWalkMode  x, y, a will be interpreted as millimeters

Definition at line 16 of file WalkNode.h.


Constructor & Destructor Documentation

WalkNode::WalkNode  )  [inline]
 

constructor

Definition at line 23 of file WalkNode.h.

WalkNode::WalkNode float  xvel,
float  yvel,
float  avel
[inline]
 

constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes velocity

Definition at line 28 of file WalkNode.h.

WalkNode::WalkNode float  xvel,
float  yvel,
float  avel,
int  steps
[inline]
 

constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes distance

Definition at line 33 of file WalkNode.h.

WalkNode::WalkNode const std::string &  name,
float  xvel,
float  yvel,
float  avel
[inline]
 

constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes velocity

Definition at line 38 of file WalkNode.h.

WalkNode::WalkNode const std::string &  name,
float  xvel,
float  yvel,
float  avel,
int  steps
[inline]
 

constructor, positive yvel is counter-clockwise from above (to match coordinate system), assumes distance

Definition at line 43 of file WalkNode.h.

WalkNode::~WalkNode  )  [inline]
 

destructor, check if we need to call our teardown

Definition at line 48 of file WalkNode.h.


Member Function Documentation

virtual void WalkNode::DoStart  )  [inline, virtual]
 

Transitions should call this when you are entering the state, so it can enable its transitions.

Reimplemented from StateNode.

Definition at line 84 of file WalkNode.h.

virtual void WalkNode::DoStop  )  [inline, virtual]
 

Transitions should call this when you are leaving the state, so it can disable its transitions.

Reimplemented from StateNode.

Definition at line 93 of file WalkNode.h.

float WalkNode::getAVelocity  )  [inline]
 

returns the velocity of the turn, positive is counter-clockwise from above (to match coordinate system)

Definition at line 82 of file WalkNode.h.

virtual MotionManager::MC_ID WalkNode::getWalkID  )  [inline, virtual]
 

use this to access the WalkMC that the WalkNode is using

Definition at line 144 of file WalkNode.h.

float WalkNode::getXVelocity  )  [inline]
 

returns the velocity in x direction (positive is forward)

Definition at line 70 of file WalkNode.h.

float WalkNode::getYVelocity  )  [inline]
 

returns the velocity in y direction (positive is forward)

Definition at line 76 of file WalkNode.h.

virtual bool WalkNode::ownsWalkID  )  [inline, virtual]
 

returns true if walkid was created (and will be destroyed) by this WalkNode - false if assigned by setWalkID()

Definition at line 147 of file WalkNode.h.

virtual void WalkNode::processEvent const EventBase e  )  [inline, virtual]
 

receive locomotionEGID status event and throw stateMachineEGID status event, ie a completion event

Reimplemented from BehaviorBase.

Definition at line 106 of file WalkNode.h.

void WalkNode::setAVelocity float  avel  )  [inline]
 

sets the velocity of the turn, positive is counter-clockwise from above (to match coordinate system)

Definition at line 79 of file WalkNode.h.

Referenced by ExploreMachine::processEvent().

void WalkNode::setDisplacement float  xd,
float  yd,
float  ad,
int  np = -1
[inline]
 

sets the velocity of the walk

Definition at line 54 of file WalkNode.h.

void WalkNode::setVelocity float  xvel,
float  yvel,
float  avel,
int  np = -1
[inline]
 

sets the velocity of the walk

Definition at line 61 of file WalkNode.h.

virtual void WalkNode::setWalkID MotionManager::MC_ID  id  )  [inline, virtual]
 

use this to force the WalkNode to use a shared WalkMC - set to MotionManager::invalid_MC_ID to reset to internally generated walk

Definition at line 132 of file WalkNode.h.

Referenced by ExploreMachine::setup(), and updateWMC().

void WalkNode::setXVelocity float  xvel  )  [inline]
 

sets the velocity in x direction (positive is forward)

Definition at line 67 of file WalkNode.h.

void WalkNode::setYVelocity float  yvel  )  [inline]
 

sets the velocity in y direction (positive is forward)

Definition at line 73 of file WalkNode.h.

void WalkNode::storeValues float  xp,
float  yp,
float  ap,
int  np,
WalkMode_t  wmode
[inline, protected]
 

stores the values and if active, calls updateWMC()

Definition at line 151 of file WalkNode.h.

Referenced by setAVelocity(), setDisplacement(), setVelocity(), setXVelocity(), and setYVelocity().

virtual void WalkNode::teardown  )  [inline, virtual]
 

removes walkid if walkidIsMine

Reimplemented from StateNode.

Definition at line 123 of file WalkNode.h.

Referenced by ~WalkNode().

void WalkNode::updateWMC  )  [inline, protected]
 

makes the appropriate calls on the WalkMC

Definition at line 164 of file WalkNode.h.

Referenced by DoStart(), and storeValues().


Member Data Documentation

float WalkNode::a [protected]
 

velocity of the turn, positive is counter-clockwise from above (to match coordinate system), or distance if walkMode is DistanceWalkMode

Definition at line 256 of file WalkNode.h.

Referenced by getAVelocity(), setAVelocity(), setXVelocity(), setYVelocity(), storeValues(), and updateWMC().

int WalkNode::n [protected]
 

number of steps (-1 means walk forever)

Definition at line 257 of file WalkNode.h.

Referenced by setAVelocity(), setXVelocity(), setYVelocity(), storeValues(), and updateWMC().

MotionManager::MC_ID WalkNode::walkid [protected]
 

the current WalkMC

Definition at line 252 of file WalkNode.h.

Referenced by DoStart(), DoStop(), getWalkID(), setWalkID(), teardown(), and updateWMC().

bool WalkNode::walkidIsMine [protected]
 

true if the walk was created in updateWalk (instead of assigned externally)

Definition at line 253 of file WalkNode.h.

Referenced by ownsWalkID(), setWalkID(), teardown(), and updateWMC().

WalkMode_t WalkNode::walkMode [protected]
 

the current interpretation of x, y, and a

Definition at line 259 of file WalkNode.h.

Referenced by storeValues(), and updateWMC().

float WalkNode::x [protected]
 

velocity in x direction (positive is forward), or distance if walkMode is DistanceWalkMode

Definition at line 254 of file WalkNode.h.

Referenced by getXVelocity(), setAVelocity(), setXVelocity(), setYVelocity(), storeValues(), and updateWMC().

float WalkNode::y [protected]
 

velocity in y direction (positive is dog's left), or distance if walkMode is DistanceWalkMode

Definition at line 255 of file WalkNode.h.

Referenced by getYVelocity(), setAVelocity(), setXVelocity(), setYVelocity(), storeValues(), and updateWMC().


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

Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:12 2005 by Doxygen 1.4.4