Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
WaypointEngine< MAX_WAY > Class Template Reference#include <WaypointEngine.h>
Inheritance diagram for WaypointEngine< MAX_WAY >:
![]() Detailed Descriptiontemplate<unsigned int MAX_WAY>
Provides computation and management of a desired path through a series of waypoints.
|
![]() 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 | ![]() 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 |
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
.
![]() 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, ![]() | ![]() 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:
![]() Here you see the results of 3 different arc values ![]() |
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 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
may cause numerical instability yielding infinitely large circles. Values larger than
will be normalized to the range
.
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:
![]() 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 typemax_turn_speed
num' - sets the maximum error-correction turning speed used for all following waypointstrack_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 functionsadd_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 116 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 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_t & | getWaypointList () |
returns a reference to waypoints | |
virtual const WaypointList_t & | getWaypointList () 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 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 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 | |
Static Public Attributes | |
static const unsigned int | MAX_WAYPOINTS = MAX_WAY |
for external access to maximum waypoints | |
Protected Member Functions | |
void | init () |
basic memory initialization | |
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 | |
static float | normalizeAngle (float a) |
will set a to be between (-pi,pi) (inclusive), just like atan2() | |
static 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 | |
Classes | |
struct | Waypoint |
Holds information about each waypoint, see WaypointEngine for overview. More... |
typedef ListMemBuf<Waypoint,MAX_WAYPOINTS> WaypointEngine< MAX_WAY >::WaypointList_t |
typedef ListMemBuf<Waypoint,MAX_WAYPOINTS>::index_t WaypointEngine< MAX_WAY >::WaypointListIter_t |
WaypointEngine< MAX_WAY >::WaypointEngine | ( | ) | [inline] |
WaypointEngine< MAX_WAY >::WaypointEngine | ( | char * | f | ) | [inline] |
unsigned int WaypointEngine< MAX_WAY >::getBinSize | ( | ) | const [inline, 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 466 of file WaypointEngine.h.
unsigned int WaypointEngine< MAX_WAY >::loadBuffer | ( | const char | buf[], | |
unsigned int | len | |||
) | [inline, virtual] |
Load from a saved buffer in memory.
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) |
Implements LoadSave.
Definition at line 480 of file WaypointEngine.h.
unsigned int WaypointEngine< MAX_WAY >::saveBuffer | ( | char | buf[], | |
unsigned int | len | |||
) | const [inline, virtual] |
Save to a given buffer in memory.
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() ) |
Implements LoadSave.
Definition at line 589 of file WaypointEngine.h.
virtual unsigned int WaypointEngine< MAX_WAY >::loadFile | ( | const char * | filename | ) | [inline, virtual] |
initiate opening of the specified file and loading/saving of all appropriate information.
filename | the file to load/save |
Reimplemented from LoadSave.
Definition at line 167 of file WaypointEngine.h.
Referenced by WaypointWalk< MAX_WAY >::LoadWaypointFile(), and WaypointEngine< MAX_WAY >::WaypointEngine().
virtual unsigned int WaypointEngine< MAX_WAY >::saveFile | ( | const char * | filename | ) | const [inline, virtual] |
initiate opening of the specified file and loading/saving of all appropriate information.
filename | the file to load/save |
Reimplemented from LoadSave.
Definition at line 168 of file WaypointEngine.h.
Referenced by WaypointWalk< MAX_WAY >::SaveWaypointFile().
void WaypointEngine< MAX_WAY >::go | ( | ) | [inline, virtual] |
starts walking towards the first waypoint
Definition at line 416 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::unpause().
void WaypointEngine< MAX_WAY >::pause | ( | ) | [inline, virtual] |
void WaypointEngine< MAX_WAY >::unpause | ( | ) | [inline, virtual] |
resumes execution of waypoint list from last paused location
Definition at line 438 of file WaypointEngine.h.
virtual void WaypointEngine< MAX_WAY >::setIsLooping | ( | bool | isl | ) | [inline, virtual] |
virtual bool WaypointEngine< MAX_WAY >::getIsLooping | ( | ) | const [inline, virtual] |
virtual WaypointList_t& WaypointEngine< MAX_WAY >::getWaypointList | ( | ) | [inline, virtual] |
virtual const WaypointList_t& WaypointEngine< MAX_WAY >::getWaypointList | ( | ) | const [inline, virtual] |
virtual WaypointListIter_t WaypointEngine< MAX_WAY >::getCurWaypointID | ( | ) | const [inline, virtual] |
virtual float WaypointEngine< MAX_WAY >::getCurX | ( | ) | const [inline, virtual] |
virtual float WaypointEngine< MAX_WAY >::getCurY | ( | ) | const [inline, virtual] |
virtual float WaypointEngine< MAX_WAY >::getCurA | ( | ) | const [inline, virtual] |
returns current heading
Definition at line 184 of file WaypointEngine.h.
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 186 of file WaypointEngine.h.
virtual void WaypointEngine< MAX_WAY >::setTracking | ( | bool | b | ) | [inline, 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 190 of file WaypointEngine.h.
virtual bool WaypointEngine< MAX_WAY >::getTracking | ( | ) | const [inline, virtual] |
bool WaypointEngine< MAX_WAY >::cycle | ( | ) | [inline, virtual] |
call this on each opportunity to check current location and correct velocities
Definition at line 448 of file WaypointEngine.h.
Referenced by WaypointWalk< MAX_WAY >::updateOutputs().
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
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 207 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::addEgocentricArc(), and WaypointEngine< MAX_WAY >::loadBuffer().
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)
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 217 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::addOffsetArc(), and WaypointEngine< MAX_WAY >::loadBuffer().
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 world coordinate frame
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 227 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::addAbsoluteArc(), and WaypointEngine< MAX_WAY >::loadBuffer().
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
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 240 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::loadBuffer().
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
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 253 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::loadBuffer().
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
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 266 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::loadBuffer().
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 274 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::checkNextWaypoint(), and WaypointEngine< MAX_WAY >::go().
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 324 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::fixArc(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().
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 346 of file WaypointEngine.h.
void WaypointEngine< MAX_WAY >::init | ( | ) | [inline, protected] |
basic memory initialization
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 639 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::WaypointEngine().
void WaypointEngine< MAX_WAY >::applyWaypoint | ( | Waypoint & | cur, | |
const Waypoint & | next | |||
) | [inline, protected] |
the Waypoint::angle field is used to store the headings
Definition at line 649 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), and WaypointEngine< MAX_WAY >::go().
void WaypointEngine< MAX_WAY >::fixArc | ( | float | arc | ) | [inline, 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 684 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::addAbsoluteArc(), WaypointEngine< MAX_WAY >::addEgocentricArc(), and WaypointEngine< MAX_WAY >::addOffsetArc().
void WaypointEngine< MAX_WAY >::computeCurrentPosition | ( | unsigned int | t | ) | [inline, 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 705 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::cycle().
void WaypointEngine< MAX_WAY >::checkNextWaypoint | ( | unsigned int | t | ) | [inline, protected] |
checks to see if curPos is within eps of targetPos; if so, setTargetWaypoint() to next waypoint
Definition at line 724 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::cycle().
void WaypointEngine< MAX_WAY >::computeIdeal | ( | unsigned int | t | ) | [inline, protected] |
computes the ideal location (idealPos) if we were following the intended path at the intended speed
Definition at line 735 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::cycle().
void WaypointEngine< MAX_WAY >::computeNewVelocity | ( | unsigned int | t | ) | [inline, protected] |
computes the velocity which should be used given the current position (curPos) relative to the ideal position (idealPos)
Definition at line 804 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::cycle().
static 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 375 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::applyWaypoint(), WaypointEngine< MAX_WAY >::computeCurrentPosition(), WaypointEngine< MAX_WAY >::computeIdeal(), and WaypointEngine< MAX_WAY >::computeNewVelocity().
static 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 384 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeNewVelocity().
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 118 of file WaypointEngine.h.
WaypointList_t WaypointEngine< MAX_WAY >::waypoints [protected] |
storage for the waypoints
Definition at line 393 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 >::getWaypointList(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::loadBuffer(), WaypointEngine< MAX_WAY >::saveBuffer(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::unpause().
bool WaypointEngine< MAX_WAY >::isRunning [protected] |
true if we're currently executing the path
Definition at line 395 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::cycle(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::pause(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::unpause().
bool WaypointEngine< MAX_WAY >::isLooping [protected] |
true if we should loop when done
Definition at line 396 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::getIsLooping(), WaypointEngine< MAX_WAY >::setIsLooping(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().
bool WaypointEngine< MAX_WAY >::isTracking [protected] |
new waypoints will use trackPath mode
Definition at line 397 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 >::getTracking(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::loadBuffer(), and WaypointEngine< MAX_WAY >::setTracking().
unsigned int WaypointEngine< MAX_WAY >::curWaypoint [protected] |
index of current waypoint
Definition at line 398 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 >::cycle(), WaypointEngine< MAX_WAY >::getCurWaypointID(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and WaypointEngine< MAX_WAY >::unpause().
unsigned int WaypointEngine< MAX_WAY >::waypointTime [protected] |
time we started working on current waypoint
Definition at line 399 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().
float WaypointEngine< MAX_WAY >::waypointDistance [protected] |
distance from sourcePos to targetPos
Definition at line 400 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::setTargetWaypoint().
float WaypointEngine< MAX_WAY >::pathLength [protected] |
distance to be traveled from sourcePos to targetPos (may differ from waypointDistance due to arcing)
Definition at line 401 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().
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 402 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::computeNewVelocity(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().
unsigned int WaypointEngine< MAX_WAY >::lastUpdateTime [protected] |
time we last updated curPos
Definition at line 403 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeCurrentPosition(), WaypointEngine< MAX_WAY >::go(), and WaypointEngine< MAX_WAY >::unpause().
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 404 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::calcAbsoluteCoords(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::init(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().
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 405 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::go(), WaypointEngine< MAX_WAY >::init(), and WaypointEngine< MAX_WAY >::setTargetWaypoint().
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 406 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().
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 407 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeIdeal(), WaypointEngine< MAX_WAY >::computeNewVelocity(), and WaypointEngine< MAX_WAY >::init().
float WaypointEngine< MAX_WAY >::curPos[3] [protected] |
current position of the robot relative to the origin
Definition at line 408 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().
float WaypointEngine< MAX_WAY >::curVel[3] [protected] |
current velocity
Definition at line 409 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().
float WaypointEngine< MAX_WAY >::eps[3] [protected] |
epsilon - "close enough" to register a hit on the waypoint
Definition at line 410 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::applyWaypoint(), WaypointEngine< MAX_WAY >::checkNextWaypoint(), WaypointEngine< MAX_WAY >::computeIdeal(), and WaypointEngine< MAX_WAY >::init().
float WaypointEngine< MAX_WAY >::Pcorr [protected] |
proportional correction factor for tracking path
Definition at line 411 of file WaypointEngine.h.
Referenced by WaypointEngine< MAX_WAY >::computeNewVelocity().
float WaypointEngine< MAX_WAY >::turnSpeed [protected] |
maximum turning speed for new waypoints
Definition at line 412 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 >::loadBuffer(), and WaypointEngine< MAX_WAY >::saveBuffer().
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:48 2007 by Doxygen 1.5.4 |