lejos.robotics.navigation
Class Waypoint

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.geom.Point2D.Float
          extended by lejos.geom.Point
              extended by lejos.robotics.navigation.Waypoint
All Implemented Interfaces:
Cloneable, Transmittable

public class Waypoint
extends Point
implements Transmittable

A sequence of way points make up a route that a robot can navigate. Waypoint extends Point, as a way point can just be a point. However, a Waypoint can optionally specify a heading that the robot must achieve when it reaches the way points. It can also optionally specify how close the robot must get to the way point in order for it to be deemed to have reached it.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float
 
Field Summary
protected  float heading
           
protected  boolean headingRequired
           
protected  float maxHeadingError
           
protected  float maxPositionError
           
 
Fields inherited from class java.awt.geom.Point2D.Float
x, y
 
Constructor Summary
Waypoint(double x, double y)
           
Waypoint(double x, double y, double heading)
           
Waypoint(Point p)
           
Waypoint(Pose p)
           
 
Method Summary
 boolean checkValidity(Pose p)
          Check that the given pose satisfies the conditions for this way point
 void dumpObject(DataOutputStream dos)
           
 double getHeading()
           
 double getMaxHeadingError()
           
 double getMaxPositionError()
           
 Pose getPose()
          Return a Pose that represents the way point.
 boolean isHeadingRequired()
           
 void loadObject(DataInputStream dis)
           
 void setMaxHeadingError(double distance)
           
 void setMaxPositionError(double distance)
           
 
Methods inherited from class lejos.geom.Point
add, addWith, angle, angleTo, clone, copyTo, dotProduct, getNormalized, leftOrth, length, makeLeftOrth, makeRightOrth, moveTo, multiply, multiplyBy, normalize, pointAt, projectOn, reverse, rightOrth, subtract, subtract, subtractWith, translate
 
Methods inherited from class java.awt.geom.Point2D.Float
getX, getY, setLocation, setLocation, toString
 
Methods inherited from class java.awt.geom.Point2D
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

heading

protected float heading

headingRequired

protected boolean headingRequired

maxPositionError

protected float maxPositionError

maxHeadingError

protected float maxHeadingError
Constructor Detail

Waypoint

public Waypoint(double x,
                double y)

Waypoint

public Waypoint(double x,
                double y,
                double heading)

Waypoint

public Waypoint(Point p)

Waypoint

public Waypoint(Pose p)
Method Detail

getHeading

public double getHeading()

isHeadingRequired

public boolean isHeadingRequired()

getMaxPositionError

public double getMaxPositionError()

setMaxPositionError

public void setMaxPositionError(double distance)

getMaxHeadingError

public double getMaxHeadingError()

setMaxHeadingError

public void setMaxHeadingError(double distance)

getPose

public Pose getPose()
Return a Pose that represents the way point. If no header is specified, it is set to zero.

Returns:
the pose corresponding to the way point

checkValidity

public boolean checkValidity(Pose p)
Check that the given pose satisfies the conditions for this way point

Parameters:
p - the Pose

dumpObject

public void dumpObject(DataOutputStream dos)
                throws IOException
Specified by:
dumpObject in interface Transmittable
Throws:
IOException

loadObject

public void loadObject(DataInputStream dis)
                throws IOException
Specified by:
loadObject in interface Transmittable
Throws:
IOException