Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

WaypointEngine Class Reference

Provides computation and management of a desired path through a series of waypoints. More...

#include <WaypointEngine.h>

Inheritance diagram for WaypointEngine:

Detailed Description

Provides computation and management of a desired path through a series of waypoints.

This is a generalized set of data structures and management code - it doesn't actually say anything about how you get from one waypoint to the other, it will just tell you where you should be going at any given time.

So, for instance, you may be interested in WaypointWalk, which will use a WalkMC to traverse the waypoints. Future development may include a WaypointPush, to push an object along a path instead of just moving the body along a path.

Although general curves between waypoints are not supported, you can use either circular arcs or straight lines.

The Waypoint class holds the actual data about each waypoint. You can specify waypoints in 3 ways: egocentric, offset, and absolute.

Waypoint_Ego.png
Egocentric: the x and y parameters are relative to the body itself; x is always forward and y is always left. Handy for turtle/logo style specification of instructions
Waypoint_Off.png
Offset: the x and y parameters are relative to the current body position, but not its heading.
Waypoint_Abs.png
Absolute: the x and y parameters are direct coordinates

These specify the position of the next waypoint, but we also need to be able to specify the orientation (heading) of the robot. This is done by specifying an angle and a mode which controls how that angle is interpreted: Waypoint::angleIsRelative, which can be true or false.

Waypoint_AngleRel.png
angleIsRelative==true: The angle is relative to the path, so that 0 will keep the robot pointed in the direction of travel, even when arcing. Similarly, $\pi/2\ (90^\circ)$ would cause the robot to walk sideways.
Waypoint_AngleAbs.png
angleIsRelative==false: The angle is relative to the world coordinate system, so a constant heading is maintained throughout execution of the path.

The final orientation of the robot is simply the heading it was facing when it reaches the end point. To turn in place, you can use a (0,0) egocentric or offset waypoint with an angle parameter.

In order to execute curves, you can supply an arc value:

Waypoint_Arc.png
Here you see the results of 3 different arc values $(60^\circ,120^\circ,180^\circ)$. Note how the arc parameter corresponds to the angle of the circle which is swept.

There are two ways to specify arcs. The add*Waypoint functions use the position arguments to specify the end point of the arc, and the arc parameter serves to "bow" the path. The add*Arc functions specify the center of the circle as the position, and the end point is inferred from the amount of the arc to sweep.

Beware that arcs greater than $180^\circ$ are entirely possible, but will create larger and larger circles which may cause the robot to initially start moving away from the destination. This isn't necessarily a bad thing, but may be unanticipated. Values approaching $2\pi\ (360^\circ)$ may cause numerical instability yielding infinitely large circles. Values larger than $2\pi\ (360^\circ)$ will be normalized to the range $[0,2\pi)$.

Dead reckoning is very prone to accruing error. It is highly recommended that you calibrate the locomotion mechanism carefully (see WalkCalibration, available under the "Walk Edit" menu with a run-time help menu) and implement some form of localization to handle the inevitable drift.

If you have a localization module in place, you can use the setCurPos() function to update the position of the robot within the world. WaypointEngine provides two ways to handle this ensuing discrepency from the path the robot had been tracing:

Waypoint_Error.png
The effect of the Waypoint::trackPath flag. When true, the robot will attempt to catch up to its "ideal" location after a perturbation. When false, the robot will ignore the "ideal" path, and just go straight to the destination from wherever perturbations may push it.

trackPath is a per-waypoint setting, setTracking() sets the default value for any new waypoints which are thereafter created (the default default is false ;)

Waypoint list files are a fairly straightforward plain text format. The extension .wyp is suggested.

The waypoint file format is:

  • '#WyP' - header to verify file type
  • A series of entries:
    • 'max_turn_speed num' - sets the maximum error-correction turning speed used for all following waypoints
    • 'track_path bool' - sets trackpath mode on or off for all following waypoints (see Waypoint::trackPath)
    • 'add_point {ego|off|abs} x_val y_val {hold|follow} angle_val speed_val arc_val' - adds the waypoint with the parameters given, see Waypoint, similar to add*Waypoint functions
    • 'add_arc {ego|off|abs} x_val y_val {hold|follow} angle_val speed_val arc_val' - adds the waypoint with the parameters given, see Waypoint, similar to add*Arc functions
  • '#END' - footer to verify ending of file

Definition at line 119 of file WaypointEngine.h.

List of all members.

Public Types

typedef std::vector< WaypointWaypointList_t
 convenient shorthand
typedef std::vector< Waypoint >
::iterator 
WaypointListIter_t
 convenient shorthand
typedef std::vector< Waypoint >
::const_iterator 
WaypointListConstIter_t
 convenient shorthand

Public Member Functions

 WaypointEngine ()
 constructor
 WaypointEngine (char *f)
 constructor
virtual unsigned int getBinSize () const
 returns a rough overestimate of the size needed
virtual unsigned int loadBuffer (const char buf[], unsigned int len, const char *filename=NULL)
 Load from a saved buffer in memory.
virtual unsigned int saveBuffer (char buf[], unsigned int len) const
 Save to a given buffer in memory.
virtual unsigned int loadFile (const char *filename)
 initiate opening of the specified file and loading/saving of all appropriate information.
virtual unsigned int saveFile (const char *filename) const
 initiate opening of the specified file and loading/saving of all appropriate information.
virtual void go ()
 starts walking towards the first waypoint
virtual void pause ()
 halts execution of waypoint list
virtual void unpause ()
 resumes execution of waypoint list from last paused location
virtual void setIsLooping (bool isl)
 sets isLooping
virtual bool getIsLooping () const
 returns isLooping
virtual WaypointList_tgetWaypointList ()
 returns a reference to waypoints
virtual const WaypointList_tgetWaypointList () const
 returns a const reference to waypoints
virtual WaypointListIter_t getCurWaypointID () const
 returns id value of current waypoint (curWaypoint)
virtual float getCurX () const
 returns current x position
virtual float getCurY () const
 returns current y position
virtual float getCurA () const
virtual void setCurPos (float x, float y, float a)
 sets the current position (for instance your localization module has an update)
virtual void setTracking (bool b)
 sets the isTracking flag, only affects future waypoints which are added, not currently listed waypoints (use getWaypointList() to modify existing waypoints)
virtual bool getTracking () const
 returns isTracking
virtual bool cycle ()
 call this on each opportunity to check current location and correct velocities
virtual void setTargetWaypoint (WaypointListIter_t iter)
 will set the currently active waypoint to another waypoint; correctly calculates location of intermediate waypoints so target location will be the same as if the intervening waypoints had actually been executed
Waypoint calcAbsoluteCoords (WaypointListIter_t it)
 if it follows the current waypoint, applies all the waypoints between curWaypoint and it and returns result as an absolute position (angle field stores heading); otherwise calls the other calcAbsoluteCoords(WaypointListIter_t, float, float, float)
Waypoint calcAbsoluteCoords (WaypointListIter_t it, float sx, float sy, float sa)
 starts at (sx, sy, heading=sa) and then applies all the waypoints up through it and returns result as an absolute position (angle field stores heading)
Adding Waypoints

these are for convenience - can also directly edit the waypoint list using access from getWaypointList()

virtual void addEgocentricWaypoint (float forward, float left, float angle, bool angleIsRelative, float fwdSpeed, float turnSpeed=-1.f)
 adds a waypoint to the end of the list, allows you to specify turtle-style instructions
virtual void addOffsetWaypoint (float x, float y, float angle, bool angleIsRelative, float fwdSpeed, float turnSpeed=-1.f)
 adds a waypoint to the end of the list, allows you to set locations relative to the location of the previous waypoint (or starting position)
virtual void addAbsoluteWaypoint (float x, float y, float angle, bool angleIsRelative, float fwdSpeed, float turnSpeed=-1.f)
 adds a waypoint to the end of the list, allows you to set locations relative to the world coordinate frame
virtual void addEgocentricArc (float forward, float left, float angle, bool angleIsRelative, float speed, float arc)
 adds a waypoint to the end of the list, using an arcing path to get there, allows you to specify turtle-style instructions to specify the focus of the arc
virtual void addOffsetArc (float x, float y, float angle, bool angleIsRelative, float speed, float arc)
 adds a waypoint to the end of the list, using an arcing path to get there, allows you to specify locations relative to previous waypoint to specify the focus of the arc
virtual void addAbsoluteArc (float x, float y, float angle, bool angleIsRelative, float speed, float arc)
 adds a waypoint to the end of the list, using an arcing path to get there, allows you to specify absolute locations to specify the focus of the arc
virtual void appendWaypoints (const WaypointList_t wpl)
 adds a waypoint to the end of the list, allows you to specify turtle-style instructions
virtual void clearWaypointList ()
 adds a waypoint to the end of the list, allows you to specify turtle-style instructions

Protected Member Functions

void init ()
 basic memory initialization
void fixArc (float arc)
 assumes the last waypoint is actually center of circle, adjusts it to be the endpoint of following arc radians around that circle instead
void computeCurrentPosition (unsigned int t)
 based on current velocity and time since last call, dead reckons current location in curPos
void checkNextWaypoint (unsigned int t)
 checks to see if curPos is within eps of targetPos; if so, setTargetWaypoint() to next waypoint
void computeIdeal (unsigned int t)
 computes the ideal location (idealPos) if we were following the intended path at the intended speed
void computeNewVelocity (unsigned int t)
 computes the velocity which should be used given the current position (curPos) relative to the ideal position (idealPos)

Static Protected Member Functions

static float tgtCreateTurnFudgeFactor (float angle)
static float fudgedAngle (float originalAngle)

Protected Attributes

WaypointList_t waypoints
 storage for the waypoints
bool isRunning
 true if we're currently executing the path
bool isLooping
 true if we should loop when done
bool isTracking
 new waypoints will use trackPath mode
WaypointListIter_t curWaypoint
 index of current waypoint
unsigned int waypointTime
 time we started working on current waypoint
float waypointDistance
 distance from sourcePos to targetPos
float pathLength
 distance to be traveled from sourcePos to targetPos (may differ from waypointDistance due to arcing)
float arcRadius
 radius of current arc, may be inf or NaN if using a straight line; can also be negative depending on direction!
unsigned int lastUpdateTime
 time we last updated curPos
float pathStartPos [3]
 position when started execution of current path (aka origin offset for relative positions which preceed an absolute waypoint)
float sourcePos [3]
 source position of the robot relative to the origin, aka absolute position of previous waypoint
float targetPos [3]
 target position of the robot relative to the origin, aka absolute position of next waypoint
float idealPos [4]
 ideal position of the robot relative to the origin, (x, y, heading, last element is desired direction of motion)
float curPos [3]
 current position of the robot relative to the origin
float curVel [3]
 current velocity
float eps [3]
 epsilon - "close enough" to register a hit on the waypoint
float Pcorr
 proportional correction factor for tracking path
float defaultTurnSpeed
 maximum turning speed for new waypoints

Member Typedef Documentation

convenient shorthand

Definition at line 122 of file WaypointEngine.h.

typedef std::vector<Waypoint>::const_iterator WaypointEngine::WaypointListConstIter_t

convenient shorthand

Definition at line 124 of file WaypointEngine.h.

typedef std::vector<Waypoint>::iterator WaypointEngine::WaypointListIter_t

convenient shorthand

Definition at line 123 of file WaypointEngine.h.


Constructor & Destructor Documentation

WaypointEngine::WaypointEngine (  ) 

constructor

Definition at line 127 of file WaypointEngine.h.

WaypointEngine::WaypointEngine ( char *  f  ) 

constructor

Definition at line 133 of file WaypointEngine.h.


Member Function Documentation

virtual void WaypointEngine::addAbsoluteArc ( float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  speed,
float  arc 
) [virtual]

adds a waypoint to the end of the list, using an arcing path to get there, allows you to specify absolute locations to specify the focus of the arc

Waypoint_Abs.png

If you would rather specify the ending point and then "bow" the path, try addAbsoluteWaypoint() followed by setting the Waypoint::arc field directly

Parameters:
x position along x of the center of the circle of the arc
y position along y of the center of the circle of the arc
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
speed is the speed to move at; millimeters per second
arc is the number of radians the arc fills; arcs near 0 (or multiples of 360) may cause numeric instability

Definition at line 246 of file WaypointEngine.h.

Referenced by loadBuffer().

virtual void WaypointEngine::addAbsoluteWaypoint ( float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  fwdSpeed,
float  turnSpeed = -1.f 
) [virtual]

adds a waypoint to the end of the list, allows you to set locations relative to the world coordinate frame

Waypoint_Abs.png
Parameters:
x position along x axis of the waypoint
y position along y axis of the waypoint
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
fwdSpeed is the speed to move at; milimeters per second
turnSpeed is the speed to turn; radians per second

Definition at line 207 of file WaypointEngine.h.

Referenced by addAbsoluteArc(), and loadBuffer().

virtual void WaypointEngine::addEgocentricArc ( float  forward,
float  left,
float  angle,
bool  angleIsRelative,
float  speed,
float  arc 
) [virtual]

adds a waypoint to the end of the list, using an arcing path to get there, allows you to specify turtle-style instructions to specify the focus of the arc

Waypoint_Ego.png

If you would rather specify the ending point and then "bow" the path, try addEgocentricWaypoint() followed by setting the Waypoint::arc field directly

Parameters:
forward distance in front of the center of the circle of the arc
left distance to the left of the center of the circle of the arc
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
speed is the speed to move at; millimeters per second
arc is the number of radians the arc fills; arcs near 0 (or multiples of 360) may cause numeric instability

Definition at line 220 of file WaypointEngine.h.

Referenced by loadBuffer().

void WaypointEngine::addEgocentricWaypoint ( float  forward,
float  left,
float  angle,
bool  angleIsRelative,
float  fwdSpeed,
float  turnSpeed = -1.f 
) [virtual]

adds a waypoint to the end of the list, allows you to specify turtle-style instructions

Waypoint_Ego.png
Parameters:
forward distance forward to move (negative to move backward of course)
left distance to the left to move (negative to move right of course)
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
fwdSpeed is the speed to move at; millimeters per second
turnSpeed is the speed to turn; radians per second

Definition at line 89 of file WaypointEngine.cc.

Referenced by addEgocentricArc(), and loadBuffer().

virtual void WaypointEngine::addOffsetArc ( float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  speed,
float  arc 
) [virtual]

adds a waypoint to the end of the list, using an arcing path to get there, allows you to specify locations relative to previous waypoint to specify the focus of the arc

Waypoint_Off.png

If you would rather specify the ending point and then "bow" the path, try addOffsetWaypoint() followed by setting the Waypoint::arc field directly

Parameters:
x distance delta along x of the center of the circle of the arc
y distance delta along y of the center of the circle of the arc
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
speed is the speed to move at; millimeters per second
arc is the number of radians the arc fills; arcs near 0 (or multiples of 360) may cause numeric instability

Definition at line 233 of file WaypointEngine.h.

Referenced by loadBuffer().

virtual void WaypointEngine::addOffsetWaypoint ( float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  fwdSpeed,
float  turnSpeed = -1.f 
) [virtual]

adds a waypoint to the end of the list, allows you to set locations relative to the location of the previous waypoint (or starting position)

Waypoint_Off.png
Parameters:
x distance delta along x axis of the waypoint
y distance delta along y axis of the waypoint
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
fwdSpeed is the speed to move at; millimeters per second
turnSpeed is the speed to turn; radians per second

Definition at line 196 of file WaypointEngine.h.

Referenced by addOffsetArc(), and loadBuffer().

virtual void WaypointEngine::appendWaypoints ( const WaypointList_t  wpl  )  [virtual]

adds a waypoint to the end of the list, allows you to specify turtle-style instructions

Waypoint_Ego.png
Parameters:
forward distance forward to move (negative to move backward of course)
left distance to the left to move (negative to move right of course)
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
fwdSpeed is the speed to move at; millimeters per second
turnSpeed is the speed to turn; radians per second

Definition at line 251 of file WaypointEngine.h.

Waypoint WaypointEngine::calcAbsoluteCoords ( WaypointListIter_t  it,
float  sx,
float  sy,
float  sa 
)

starts at (sx, sy, heading=sa) and then applies all the waypoints up through it and returns result as an absolute position (angle field stores heading)

This is replicated in WaypointList, so any updates should be made there as well

Definition at line 287 of file WaypointEngine.h.

Waypoint WaypointEngine::calcAbsoluteCoords ( WaypointListIter_t  it  ) 

if it follows the current waypoint, applies all the waypoints between curWaypoint and it and returns result as an absolute position (angle field stores heading); otherwise calls the other calcAbsoluteCoords(WaypointListIter_t, float, float, float)

Definition at line 264 of file WaypointEngine.h.

Referenced by fixArc(), and setTargetWaypoint().

void WaypointEngine::checkNextWaypoint ( unsigned int  t  )  [protected]

checks to see if curPos is within eps of targetPos; if so, setTargetWaypoint() to next waypoint

Definition at line 364 of file WaypointEngine.cc.

Referenced by cycle().

virtual void WaypointEngine::clearWaypointList (  )  [virtual]

adds a waypoint to the end of the list, allows you to specify turtle-style instructions

Waypoint_Ego.png
Parameters:
forward distance forward to move (negative to move backward of course)
left distance to the left to move (negative to move right of course)
angle angle of attack to use on the path
angleIsRelative controls interpretation of angle; true means angle specifies an offset from the bearing of the target waypoint, false means maintain an absolute heading
fwdSpeed is the speed to move at; millimeters per second
turnSpeed is the speed to turn; radians per second

Definition at line 255 of file WaypointEngine.h.

void WaypointEngine::computeCurrentPosition ( unsigned int  t  )  [protected]

based on current velocity and time since last call, dead reckons current location in curPos

doesn't take acceleration into account, but should... :(

Definition at line 346 of file WaypointEngine.cc.

Referenced by cycle().

void WaypointEngine::computeIdeal ( unsigned int  t  )  [protected]

computes the ideal location (idealPos) if we were following the intended path at the intended speed

Definition at line 373 of file WaypointEngine.cc.

Referenced by cycle().

void WaypointEngine::computeNewVelocity ( unsigned int  t  )  [protected]

computes the velocity which should be used given the current position (curPos) relative to the ideal position (idealPos)

Definition at line 443 of file WaypointEngine.cc.

Referenced by cycle().

bool WaypointEngine::cycle (  )  [virtual]

call this on each opportunity to check current location and correct velocities

Returns:
isRunning for convenience of checking if anything is happening

Definition at line 36 of file WaypointEngine.cc.

void WaypointEngine::fixArc ( float  arc  )  [protected]

assumes the last waypoint is actually center of circle, adjusts it to be the endpoint of following arc radians around that circle instead

This is replicated in WaypointList, so any updates should be made there as well

Definition at line 324 of file WaypointEngine.cc.

Referenced by addAbsoluteArc(), addEgocentricArc(), and addOffsetArc().

float WaypointEngine::fudgedAngle ( float  originalAngle  )  [static, protected]

Definition at line 81 of file WaypointEngine.cc.

Referenced by addEgocentricWaypoint().

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

returns a rough overestimate of the size needed

pretends we need to switch max_turn_speed and track_path on every point, and the longest options are given for every point

Implements LoadSave.

Definition at line 144 of file WaypointEngine.cc.

virtual float WaypointEngine::getCurA (  )  const [virtual]

returns current heading

Definition at line 162 of file WaypointEngine.h.

virtual WaypointListIter_t WaypointEngine::getCurWaypointID (  )  const [virtual]

returns id value of current waypoint (curWaypoint)

Definition at line 158 of file WaypointEngine.h.

virtual float WaypointEngine::getCurX (  )  const [virtual]

returns current x position

Definition at line 160 of file WaypointEngine.h.

virtual float WaypointEngine::getCurY (  )  const [virtual]

returns current y position

Definition at line 161 of file WaypointEngine.h.

virtual bool WaypointEngine::getIsLooping (  )  const [virtual]

returns isLooping

Definition at line 153 of file WaypointEngine.h.

virtual bool WaypointEngine::getTracking (  )  const [virtual]

returns isTracking

Definition at line 169 of file WaypointEngine.h.

virtual const WaypointList_t& WaypointEngine::getWaypointList (  )  const [virtual]

returns a const reference to waypoints

Definition at line 156 of file WaypointEngine.h.

virtual WaypointList_t& WaypointEngine::getWaypointList (  )  [virtual]

returns a reference to waypoints

Definition at line 155 of file WaypointEngine.h.

void WaypointEngine::go (  )  [virtual]

starts walking towards the first waypoint

Definition at line 4 of file WaypointEngine.cc.

Referenced by unpause().

void WaypointEngine::init (  )  [protected]

basic memory initialization

Definition at line 314 of file WaypointEngine.cc.

Referenced by WaypointEngine().

unsigned int WaypointEngine::loadBuffer ( const char  buf[],
unsigned int  len,
const char *  filename = NULL 
) [virtual]

Load from a saved buffer in memory.

Parameters:
buf pointer to the memory where you should begin loading
len length of buf available (this isn't necessarily all yours, there might be other things following your data)
Returns:
the number of bytes actually used

Implements LoadSave.

Definition at line 157 of file WaypointEngine.cc.

virtual unsigned int WaypointEngine::loadFile ( const char *  filename  )  [virtual]

initiate opening of the specified file and loading/saving of all appropriate information.

Parameters:
filename the file to load/save
Returns:
number of bytes read/written, 0 if error (or empty)

Reimplemented from LoadSave.

Definition at line 145 of file WaypointEngine.h.

Referenced by WaypointEngine().

void WaypointEngine::pause (  )  [virtual]

halts execution of waypoint list

Definition at line 22 of file WaypointEngine.cc.

unsigned int WaypointEngine::saveBuffer ( char  buf[],
unsigned int  len 
) const [virtual]

Save to a given buffer in memory.

Parameters:
buf pointer to the memory where you should begin writing
len length of buf available. (this isn't necessarily all yours, constrain yourself to what you returned in getBinSize() )
Returns:
the number of bytes actually used

Implements LoadSave.

Definition at line 265 of file WaypointEngine.cc.

virtual unsigned int WaypointEngine::saveFile ( const char *  filename  )  const [virtual]

initiate opening of the specified file and loading/saving of all appropriate information.

Parameters:
filename the file to load/save
Returns:
number of bytes read/written, 0 if error (or empty)

Reimplemented from LoadSave.

Definition at line 146 of file WaypointEngine.h.

virtual void WaypointEngine::setCurPos ( float  x,
float  y,
float  a 
) [virtual]

sets the current position (for instance your localization module has an update)

Definition at line 164 of file WaypointEngine.h.

virtual void WaypointEngine::setIsLooping ( bool  isl  )  [virtual]

sets isLooping

Definition at line 152 of file WaypointEngine.h.

void WaypointEngine::setTargetWaypoint ( WaypointListIter_t  iter  )  [virtual]

will set the currently active waypoint to another waypoint; correctly calculates location of intermediate waypoints so target location will be the same as if the intervening waypoints had actually been executed

Definition at line 94 of file WaypointEngine.cc.

Referenced by checkNextWaypoint(), and go().

virtual void WaypointEngine::setTracking ( bool  b  )  [virtual]

sets the isTracking flag, only affects future waypoints which are added, not currently listed waypoints (use getWaypointList() to modify existing waypoints)

Definition at line 168 of file WaypointEngine.h.

float WaypointEngine::tgtCreateTurnFudgeFactor ( float  angle  )  [static, protected]

Definition at line 54 of file WaypointEngine.cc.

Referenced by fudgedAngle().

void WaypointEngine::unpause (  )  [virtual]

resumes execution of waypoint list from last paused location

Definition at line 27 of file WaypointEngine.cc.


Member Data Documentation

radius of current arc, may be inf or NaN if using a straight line; can also be negative depending on direction!

Definition at line 326 of file WaypointEngine.h.

Referenced by computeIdeal(), computeNewVelocity(), and setTargetWaypoint().

float WaypointEngine::curPos[3] [protected]

current position of the robot relative to the origin

Definition at line 332 of file WaypointEngine.h.

Referenced by checkNextWaypoint(), computeCurrentPosition(), computeIdeal(), computeNewVelocity(), getCurA(), getCurX(), getCurY(), go(), init(), setCurPos(), and setTargetWaypoint().

float WaypointEngine::curVel[3] [protected]

current velocity

Definition at line 333 of file WaypointEngine.h.

Referenced by computeCurrentPosition(), computeNewVelocity(), go(), init(), setTargetWaypoint(), and unpause().

maximum turning speed for new waypoints

Definition at line 336 of file WaypointEngine.h.

Referenced by addAbsoluteWaypoint(), addEgocentricWaypoint(), addOffsetWaypoint(), calcAbsoluteCoords(), go(), and loadBuffer().

float WaypointEngine::eps[3] [protected]

epsilon - "close enough" to register a hit on the waypoint

Definition at line 334 of file WaypointEngine.h.

Referenced by calcAbsoluteCoords(), checkNextWaypoint(), computeIdeal(), go(), and init().

ideal position of the robot relative to the origin, (x, y, heading, last element is desired direction of motion)

Definition at line 331 of file WaypointEngine.h.

Referenced by computeIdeal(), computeNewVelocity(), and init().

bool WaypointEngine::isLooping [protected]

true if we should loop when done

Definition at line 320 of file WaypointEngine.h.

Referenced by getIsLooping(), setIsLooping(), and setTargetWaypoint().

bool WaypointEngine::isRunning [protected]

true if we're currently executing the path

Definition at line 319 of file WaypointEngine.h.

Referenced by cycle(), go(), pause(), setTargetWaypoint(), and unpause().

bool WaypointEngine::isTracking [protected]

new waypoints will use trackPath mode

Definition at line 321 of file WaypointEngine.h.

Referenced by addAbsoluteWaypoint(), addEgocentricWaypoint(), addOffsetWaypoint(), calcAbsoluteCoords(), getTracking(), go(), loadBuffer(), and setTracking().

unsigned int WaypointEngine::lastUpdateTime [protected]

time we last updated curPos

Definition at line 327 of file WaypointEngine.h.

Referenced by computeCurrentPosition(), go(), and unpause().

distance to be traveled from sourcePos to targetPos (may differ from waypointDistance due to arcing)

Definition at line 325 of file WaypointEngine.h.

Referenced by computeIdeal(), and setTargetWaypoint().

position when started execution of current path (aka origin offset for relative positions which preceed an absolute waypoint)

Definition at line 328 of file WaypointEngine.h.

Referenced by calcAbsoluteCoords(), fixArc(), go(), init(), and setTargetWaypoint().

proportional correction factor for tracking path

Definition at line 335 of file WaypointEngine.h.

Referenced by computeNewVelocity().

source position of the robot relative to the origin, aka absolute position of previous waypoint

Definition at line 329 of file WaypointEngine.h.

Referenced by computeIdeal(), go(), init(), and setTargetWaypoint().

target position of the robot relative to the origin, aka absolute position of next waypoint

Definition at line 330 of file WaypointEngine.h.

Referenced by calcAbsoluteCoords(), checkNextWaypoint(), computeIdeal(), computeNewVelocity(), go(), init(), and setTargetWaypoint().

distance from sourcePos to targetPos

Definition at line 324 of file WaypointEngine.h.

Referenced by setTargetWaypoint().

unsigned int WaypointEngine::waypointTime [protected]

time we started working on current waypoint

Definition at line 323 of file WaypointEngine.h.

Referenced by computeIdeal(), and setTargetWaypoint().


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

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