Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

WalkNode Class Reference

A StateNode for walking using WalkMC. More...

#include <WalkNode.h>

Inheritance diagram for WalkNode:

Detailed Description

A StateNode for walking using WalkMC.

The WalkNode can handle either velocities or displacements.

To specify a velocity with no end, use the 3-tuple constructor:

  WalkNode(vx,vy,va)

To specify a velocity for a specific amount of time, which will then trigger a completion event:

  WalkNode(vx,vy,va, time, WalkNode::VEL) 

(You could also use the "endless" velocity constructor with a TimeOutTrans)

To have WalkNode interpret the (x,y,a) as a distance to travel instead of velocity, pass false at the end instead:

  WalkNode(dx,dy,da, time, WalkNode::DISP)

The time will be subject to speed limits of the underlying WalkMC, so it may take more time to complete. In particular, this means you can simply pass time=0 for a displacement and this will be extended to the maximum speed:

  WalkNode(dx,dy,da, 0, WalkNode::DISP); // zero time implies max speed for displacements

Definition at line 89 of file WalkNode.h.

List of all members.

Public Types

enum  Mode_t { DISP = 0, VEL = 1 }

Public Member Functions

 WalkNode ()
 constructor
 WalkNode (const std::string &name, const std::string filename="")
 constructor
 WalkNode (float xvel, float yvel, float avel, const std::string filename="")
 constructor: velocities in mm/sec and radians/sec
 WalkNode (const std::string &name, float xvel, float yvel, float avel, const std::string filename="")
 constructor: velocities in mm/sec and radians/sec
 WalkNode (float x, float y, float a, float time, Mode_t velocityMode, const std::string filename="")
 constructor: displacements in mm and radians, time parameter in seconds but will be extended to fit within max speed
 WalkNode (const std::string &name, float x, float y, float a, float time, Mode_t velocityMode, const std::string filename="")
 constructor: pass displacement as velocity or distance and time, isVelocity controls interpretation of x, y, and a
void setDisplacement (float xdist, float ydist, float adist, float time=0)
 sets the velocity of the walk
void setVelocity (float xvel, float yvel, float avel)
 sets the velocity of the walk
void setVelocity (float xvel, float yvel, float avel, float time)
 sets the velocity of the walk
virtual void stop ()
 Removes the motion command from the motion manager if it was our own creation.

Protected Member Functions

virtual void preStart ()
 Adds the motion command to the motion manager, but stops it from running until the user has a chance to program it.
virtual void postStart ()
 Adds a listener and then starts the motion command.

Protected Attributes

WalkRequest req
 stores settings from constructor or a signal transition

Member Enumeration Documentation

Enumerator:
DISP 

use with constructors to indicate displacement mode

VEL 

use with constructors to indicate velocity mode

Definition at line 91 of file WalkNode.h.


Constructor & Destructor Documentation

WalkNode::WalkNode (  ) 

constructor

Definition at line 97 of file WalkNode.h.

WalkNode::WalkNode ( const std::string &  name,
const std::string  filename = "" 
)

constructor

Definition at line 100 of file WalkNode.h.

WalkNode::WalkNode ( float  xvel,
float  yvel,
float  avel,
const std::string  filename = "" 
)

constructor: velocities in mm/sec and radians/sec

Definition at line 104 of file WalkNode.h.

WalkNode::WalkNode ( const std::string &  name,
float  xvel,
float  yvel,
float  avel,
const std::string  filename = "" 
)

constructor: velocities in mm/sec and radians/sec

Definition at line 108 of file WalkNode.h.

WalkNode::WalkNode ( float  x,
float  y,
float  a,
float  time,
Mode_t  velocityMode,
const std::string  filename = "" 
)

constructor: displacements in mm and radians, time parameter in seconds but will be extended to fit within max speed

Parameters:
x if velocityMode is VEL, the speed (mm/s) to move forward, else the distance (mm)
y if velocityMode is VEL, the speed (mm/s) to move to the left, else the distance (mm)
a if velocityMode is VEL, the speed (radians/s) to rotate to the left, else the distance (radians)
time the duration of the walk (seconds), if isVelocity is false the velocity will still be subject to the walk's calculated limits, so just pass 0 for max speed
velocityMode controls interpretation of x, y, and a
filename loads a parameter file to control walk gait

Definition at line 118 of file WalkNode.h.

WalkNode::WalkNode ( const std::string &  name,
float  x,
float  y,
float  a,
float  time,
Mode_t  velocityMode,
const std::string  filename = "" 
)

constructor: pass displacement as velocity or distance and time, isVelocity controls interpretation of x, y, and a

Parameters:
name an instance name for the node (mostly useful for debugging)
x if velocityMode is VEL, the speed (mm/s) to move forward, else the distance (mm)
y if velocityMode is VEL, the speed (mm/s) to move to the left, else the distance (mm)
a if velocityMode is VEL, the speed (radians/s) to rotate to the left, else the distance (radians)
time the duration of the walk (seconds), if velocityMode is DISP the velocity will still be subject to the walk's calculated limits, so just pass 0 for max speed
velocityMode controls interpretation of x, y, and a
filename loads a parameter file to control walk gait

Definition at line 129 of file WalkNode.h.


Member Function Documentation

virtual void WalkNode::postStart (  )  [protected, virtual]

Adds a listener and then starts the motion command.

Reimplemented from MCNode< WalkMC, defWalkNodeName, defWalkNodeDesc >.

virtual void WalkNode::preStart (  )  [protected, virtual]

Adds the motion command to the motion manager, but stops it from running until the user has a chance to program it.

Reimplemented from MCNode< WalkMC, defWalkNodeName, defWalkNodeDesc >.

void WalkNode::setDisplacement ( float  xdist,
float  ydist,
float  adist,
float  time = 0 
)

sets the velocity of the walk

Parameters:
xdist x displacement (mm, positive is forward)
ydist y displacement (mm, positive is left)
adist angular displacement (rad, positive is counter-clockwise)
time how many seconds to take to achieve displacement (limited to walk's max speed, so time=0 implies max speed)
void WalkNode::setVelocity ( float  xvel,
float  yvel,
float  avel,
float  time 
)

sets the velocity of the walk

Parameters:
xvel x velocity (mm/s, positive is forward)
yvel y velocity (mm/s, positive is left)
avel angular velocity (rad/s, positive is counter-clockwise)
time is seconds until stopping and posting completion
void WalkNode::setVelocity ( float  xvel,
float  yvel,
float  avel 
)

sets the velocity of the walk

Parameters:
xvel x velocity (mm/s, positive is forward)
yvel y velocity (mm/s, positive is left)
avel angular velocity (rad/s, positive is counter-clockwise)
virtual void WalkNode::stop (  )  [virtual]

Removes the motion command from the motion manager if it was our own creation.

Reimplemented from MCNodeBase.


Member Data Documentation


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

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