WalkNode Class Reference#include <WalkNode.h>
Inheritance diagram for WalkNode:
[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
|
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] |
|
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. |
|
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] |
|
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. |
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] |
|
virtual void WalkNode::teardown |
( |
|
) |
[inline, virtual] |
|
void WalkNode::updateWMC |
( |
|
) |
[inline, protected] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
|