Homepage Demos Overview Downloads Tutorials Reference
Credits

WaypointEngine< MAX_WAY > Class Template Reference

#include <WaypointEngine.h>

Inheritance diagram for WaypointEngine< MAX_WAY >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<unsigned int MAX_WAY>
class WaypointEngine< MAX_WAY >

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.

  • 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 a series of instructions which specify the waypoints.
  • Offset: the x and y parameters are relative to the current body position, but not its heading.
  • Absolute: the x and y parameters are direct coordinates

In addition, you can specify how to handle the heading of the body while the path is executing. You can specify a relative offset to the direction of travel (for instance, to walk sideways instead of forward), or an absolute value (to always face a certain direction while traveling)

Dead reckoning is very prone to accruing error. It is highly recommended that you calibrate the locomotion mechanism carefully and implement some form of localization to handle the inevitable drift.

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

The 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 56 of file WaypointEngine.h.

Public Types

typedef ListMemBuf< Waypoint,
MAX_WAYPOINTS
WaypointList_t
 convenient shorthand
typedef ListMemBuf< Waypoint,
MAX_WAYPOINTS >::index_t 
WaypointListIter_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)
 Load from a saved buffer.
virtual unsigned int SaveBuffer (char buf[], unsigned int len) const
 Save to a given buffer.
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 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 speed)
 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 speed)
 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 speed)
 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 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

Static Public Attributes

const unsigned int MAX_WAYPOINTS = MAX_WAY
 for external access to maximum waypoints

Protected Member Functions

void init ()
 if next is a relative waypoint (offset or egocentric), it is added to the location held in cur; otherwise if next is absolute, cur is set to next
void applyWaypoint (Waypoint &cur, const Waypoint &next)
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

float normalizeAngle (float a)
 will set a to be between (-pi,pi) (inclusive), just like atan2()
float clipRange (float x, float min, float max)
 returns x such that it is at most max and at minimum min

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
unsigned int 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 turnSpeed
 maximum turning speed for new waypoints


Member Typedef Documentation

template<unsigned int MAX_WAY>
typedef ListMemBuf<Waypoint,MAX_WAYPOINTS> WaypointEngine< MAX_WAY >::WaypointList_t
 

convenient shorthand

Definition at line 85 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::getWaypointList().

template<unsigned int MAX_WAY>
typedef ListMemBuf<Waypoint,MAX_WAYPOINTS>::index_t WaypointEngine< MAX_WAY >::WaypointListIter_t
 

convenient shorthand

Definition at line 86 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::fixArc(), WaypointEngine< MAX_WAY >::getCurWaypointID(), and WaypointEngine< MAX_WAY >::SaveBuffer().


Constructor & Destructor Documentation

template<unsigned int MAX_WAY>
WaypointEngine< MAX_WAY >::WaypointEngine  )  [inline]
 

constructor

Definition at line 89 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
WaypointEngine< MAX_WAY >::WaypointEngine char *  f  )  [inline]
 

constructor

Definition at line 95 of file WaypointEngine.h.


Member Function Documentation

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::addAbsoluteArc float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  speed,
float  arc
[inline, 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

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; meters 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 195 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::LoadBuffer().

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::addAbsoluteWaypoint float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  speed
[inline, 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)

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
speed is the speed to move at; meters per second

Definition at line 159 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::addAbsoluteArc(), and WaypointEngine< MAX_WAY >::LoadBuffer().

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::addEgocentricArc float  forward,
float  left,
float  angle,
bool  angleIsRelative,
float  speed,
float  arc
[inline, 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

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; meters 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 171 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::LoadBuffer().

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::addEgocentricWaypoint float  forward,
float  left,
float  angle,
bool  angleIsRelative,
float  speed
[inline, virtual]
 

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

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
speed is the speed to move at; meters per second

Definition at line 141 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::addEgocentricArc(), and WaypointEngine< MAX_WAY >::LoadBuffer().

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::addOffsetArc float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  speed,
float  arc
[inline, 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

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; meters 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 183 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::LoadBuffer().

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::addOffsetWaypoint float  x,
float  y,
float  angle,
bool  angleIsRelative,
float  speed
[inline, 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)

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
speed is the speed to move at; meters per second

Definition at line 150 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::addOffsetArc(), and WaypointEngine< MAX_WAY >::LoadBuffer().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::applyWaypoint Waypoint cur,
const Waypoint next
[protected]
 

the Waypoint::angle field is used to store the headings

Definition at line 556 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), and WaypointEngine< MAX_WAY >::go().

template<unsigned int MAX_WAY>
Waypoint WaypointEngine< MAX_WAY >::calcAbsoluteCoords WaypointListIter_t  it,
float  sx,
float  sy,
float  sa
[inline]
 

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)

Definition at line 275 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
Waypoint WaypointEngine< MAX_WAY >::calcAbsoluteCoords WaypointListIter_t  it  )  [inline]
 

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 253 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::fixArc(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::checkNextWaypoint unsigned int  t  )  [protected]
 

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

Definition at line 631 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::cycle().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::clipRange float  x,
float  min,
float  max
[inline, static, protected]
 

returns x such that it is at most max and at minimum min

Definition at line 313 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeNewVelocity().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::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 612 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::cycle().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::computeIdeal unsigned int  t  )  [protected]
 

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

Definition at line 642 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::cycle().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::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 711 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::cycle().

template<unsigned int MAX_WAY>
bool WaypointEngine< MAX_WAY >::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 377 of file WaypointEngine.h.

Referenced by WaypointWalk< MAX_WAY >::updateOutputs().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::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

Definition at line 591 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::addAbsoluteArc(), WaypointEngine< MAX_WAY >::addEgocentricArc(), and WaypointEngine< MAX_WAY >::addOffsetArc().

template<unsigned int MAX_WAY>
unsigned int WaypointEngine< MAX_WAY >::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 395 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual float WaypointEngine< MAX_WAY >::getCurA  )  const [inline, virtual]
 

returns current heading

Definition at line 122 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual WaypointListIter_t WaypointEngine< MAX_WAY >::getCurWaypointID  )  const [inline, virtual]
 

returns id value of current waypoint (curWaypoint)

Definition at line 118 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual float WaypointEngine< MAX_WAY >::getCurX  )  const [inline, virtual]
 

returns current x position

Definition at line 120 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual float WaypointEngine< MAX_WAY >::getCurY  )  const [inline, virtual]
 

returns current y position

Definition at line 121 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual bool WaypointEngine< MAX_WAY >::getIsLooping  )  const [inline, virtual]
 

returns isLooping

Definition at line 113 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual const WaypointList_t& WaypointEngine< MAX_WAY >::getWaypointList  )  const [inline, virtual]
 

returns a const reference to waypoints

Definition at line 116 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual WaypointList_t& WaypointEngine< MAX_WAY >::getWaypointList  )  [inline, virtual]
 

returns a reference to waypoints

Definition at line 115 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::go  )  [virtual]
 

starts walking towards the first waypoint

Definition at line 345 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::unpause().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::init  )  [protected]
 

if next is a relative waypoint (offset or egocentric), it is added to the location held in cur; otherwise if next is absolute, cur is set to next

Definition at line 546 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
unsigned int WaypointEngine< MAX_WAY >::LoadBuffer const char  buf[],
unsigned int  len
[virtual]
 

Load from a saved buffer.

Parameters:
buf pointer to the memory where you should begin loading
len length of buf available (this isn't all yours, might be more stuff saved after yours)
Returns:
the number of bytes actually used

Implements LoadSave.

Definition at line 409 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::normalizeAngle float  a  )  [inline, static, protected]
 

will set a to be between (-pi,pi) (inclusive), just like atan2()

Definition at line 304 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::applyWaypoint(), WaypointEngine< MAX_WAY >::computeCurrentPosition(), WaypointEngine< MAX_WAY >::computeIdeal(), and WaypointEngine< MAX_WAY >::computeNewVelocity().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::pause  )  [virtual]
 

halts execution of waypoint list

Definition at line 362 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
unsigned int WaypointEngine< MAX_WAY >::SaveBuffer char  buf[],
unsigned int  len
const [virtual]
 

Save to a given buffer.

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

Implements LoadSave.

Definition at line 496 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::setCurPos float  x,
float  y,
float  a
[inline, virtual]
 

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

Definition at line 124 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::setIsLooping bool  isl  )  [inline, virtual]
 

sets isLooping

Definition at line 112 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
virtual void WaypointEngine< MAX_WAY >::setTargetWaypoint WaypointListIter_t  iter  )  [inline, 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 203 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::checkNextWaypoint(), and WaypointEngine< MAX_WAY >::go().

template<unsigned int MAX_WAY>
void WaypointEngine< MAX_WAY >::unpause  )  [virtual]
 

resumes execution of waypoint list from last paused location

Definition at line 367 of file WaypointEngine.h.


Member Data Documentation

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::arcRadius [protected]
 

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

Definition at line 331 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::computeNewVelocity(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::curPos[3] [protected]
 

current position of the robot relative to the origin

Definition at line 337 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::checkNextWaypoint(), WaypointEngine< MAX_WAY >::computeCurrentPosition(), WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::computeNewVelocity(), WaypointEngine< MAX_WAY >::getCurA(), WaypointEngine< MAX_WAY >::getCurX(), WaypointEngine< MAX_WAY >::getCurY(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::init(), WaypointEngine< MAX_WAY >::setCurPos(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::curVel[3] [protected]
 

current velocity

Definition at line 338 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeCurrentPosition(), WaypointEngine< MAX_WAY >::computeNewVelocity(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::init(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::unpause().

template<unsigned int MAX_WAY>
unsigned int WaypointEngine< MAX_WAY >::curWaypoint [protected]
 

index of current waypoint

Definition at line 327 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::checkNextWaypoint(), WaypointEngine< MAX_WAY >::cycle(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), WaypointEngine< MAX_WAY >::unpause(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::eps[3] [protected]
 

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

Definition at line 339 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::applyWaypoint(), WaypointEngine< MAX_WAY >::checkNextWaypoint(), WaypointEngine< MAX_WAY >::computeIdeal(), and WaypointEngine< MAX_WAY >::init().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::idealPos[4] [protected]
 

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

Definition at line 336 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::computeNewVelocity(), and WaypointEngine< MAX_WAY >::init().

template<unsigned int MAX_WAY>
bool WaypointEngine< MAX_WAY >::isLooping [protected]
 

true if we should loop when done

Definition at line 325 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::setIsLooping(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
bool WaypointEngine< MAX_WAY >::isRunning [protected]
 

true if we're currently executing the path

Definition at line 324 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::pause(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), WaypointEngine< MAX_WAY >::unpause(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
bool WaypointEngine< MAX_WAY >::isTracking [protected]
 

new waypoints will use trackPath mode

Definition at line 326 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::addAbsoluteWaypoint(), WaypointEngine< MAX_WAY >::addEgocentricWaypoint(), WaypointEngine< MAX_WAY >::addOffsetWaypoint(), WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::go(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
unsigned int WaypointEngine< MAX_WAY >::lastUpdateTime [protected]
 

time we last updated curPos

Definition at line 332 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeCurrentPosition(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::unpause(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
const unsigned int WaypointEngine< MAX_WAY >::MAX_WAYPOINTS = MAX_WAY [static]
 

for external access to maximum waypoints

Reimplemented in WaypointWalk< MAX_WAY >.

Definition at line 58 of file WaypointEngine.h.

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::pathLength [protected]
 

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

Definition at line 330 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::pathStartPos[3] [protected]
 

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

Definition at line 333 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::init(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::Pcorr [protected]
 

proportional correction factor for tracking path

Definition at line 340 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeNewVelocity(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::sourcePos[3] [protected]
 

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

Definition at line 334 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::init(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::targetPos[3] [protected]
 

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

Definition at line 335 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::checkNextWaypoint(), WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::computeNewVelocity(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::init(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::turnSpeed [protected]
 

maximum turning speed for new waypoints

Definition at line 341 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::addAbsoluteWaypoint(), WaypointEngine< MAX_WAY >::addEgocentricWaypoint(), WaypointEngine< MAX_WAY >::addOffsetWaypoint(), WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::Waypoint::Waypoint(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
float WaypointEngine< MAX_WAY >::waypointDistance [protected]
 

distance from sourcePos to targetPos

Definition at line 329 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
WaypointList_t WaypointEngine< MAX_WAY >::waypoints [protected]
 

storage for the waypoints

Definition at line 322 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::addAbsoluteWaypoint(), WaypointEngine< MAX_WAY >::addEgocentricWaypoint(), WaypointEngine< MAX_WAY >::addOffsetWaypoint(), WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::checkNextWaypoint(), WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::computeNewVelocity(), WaypointEngine< MAX_WAY >::cycle(), WaypointEngine< MAX_WAY >::fixArc(), WaypointEngine< MAX_WAY >::getBinSize(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::LoadBuffer(), WaypointEngine< MAX_WAY >::SaveBuffer(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), WaypointEngine< MAX_WAY >::unpause(), and WaypointEngine< MAX_WAY >::WaypointEngine().

template<unsigned int MAX_WAY>
unsigned int WaypointEngine< MAX_WAY >::waypointTime [protected]
 

time we started working on current waypoint

Definition at line 328 of file WaypointEngine.h.

Referenced by WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::WaypointEngine().


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

Tekkotsu v2.2
Generated Tue Oct 19 14:20:25 2004 by Doxygen 1.3.9.1