lejos.robotics.navigation
Class Waypoint
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Float
lejos.geom.Point
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.
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 |
heading
protected float heading
headingRequired
protected boolean headingRequired
maxPositionError
protected float maxPositionError
maxHeadingError
protected float maxHeadingError
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)
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