lejos.navigation
Class WaypointNavigator

java.lang.Object
  extended by lejos.navigation.SimpleNavigator
      extended by lejos.navigation.WaypointNavigator
All Implemented Interfaces:
Navigator

public class WaypointNavigator
extends SimpleNavigator

The WaypointNavigator class extends the SimpleNavigator allowing the specify a path along a set of coordinates.

Author:
Dirk Sturzebecher - 20090131 - initial version

Constructor Summary
WaypointNavigator(Pilot pilot, float x, float y, float heading)
          Create a WaypointNavigator.
 
Method Summary
 void add(float xpos, float ypos, float turnSpeed, float moveSpeed)
          Add a point to the path to move.
 void clear()
          Stop the robot and clear the queue.
 void execute()
          Start to move along the list of points in the queue.
 
Methods inherited from class lejos.navigation.SimpleNavigator
angleTo, backward, distanceTo, forward, getAngle, getPilot, getX, getY, goTo, goTo, isMoving, rotate, rotate, rotateLeft, rotateRight, rotateTo, rotateTo, setMoveSpeed, setPosition, setSpeed, setTurnSpeed, stop, travel, travel, turn, turn, turn, updatePosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaypointNavigator

public WaypointNavigator(Pilot pilot,
                         float x,
                         float y,
                         float heading)
Create a WaypointNavigator. Just add points to the queue to determine path.

Parameters:
pilot - The Pilot to use.
x - The starting x position.
y - The starting y position.
heading - The starting heading.
Method Detail

clear

public void clear()
Stop the robot and clear the queue.


add

public void add(float xpos,
                float ypos,
                float turnSpeed,
                float moveSpeed)
Add a point to the path to move.

Parameters:
xpos - The x coordinate.
ypos - The y coordinate.
turnSpeed - The speed to use for turns.
moveSpeed - The speed to use for moves.

execute

public void execute()
Start to move along the list of points in the queue.