Package lejos.robotics.navigation
Class Waypoint
- java.lang.Object
-
- lejos.robotics.geometry.Point2D
-
- lejos.robotics.geometry.Point2D.Float
-
- lejos.robotics.geometry.Point
-
- lejos.robotics.navigation.Waypoint
-
- All Implemented Interfaces:
java.lang.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 lejos.robotics.geometry.Point2D
Point2D.Double, Point2D.Float
-
-
Field Summary
Fields Modifier and Type Field Description protected floatheadingprotected booleanheadingRequiredprotected floatmaxHeadingErrorprotected floatmaxPositionError-
Fields inherited from class lejos.robotics.geometry.Point2D.Float
x, y
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckValidity(Pose p)Check that the given pose satisfies the conditions for this way pointvoiddumpObject(java.io.DataOutputStream dos)doublegetHeading()doublegetMaxHeadingError()doublegetMaxPositionError()PosegetPose()Return a Pose that represents the way point.booleanisHeadingRequired()voidloadObject(java.io.DataInputStream dis)voidsetMaxHeadingError(double distance)voidsetMaxPositionError(double distance)-
Methods inherited from class lejos.robotics.geometry.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 lejos.robotics.geometry.Point2D.Float
getX, getY, setLocation, setLocation, toString
-
Methods inherited from class lejos.robotics.geometry.Point2D
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, setLocation
-
-
-
-
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(java.io.DataOutputStream dos) throws java.io.IOException- Specified by:
dumpObjectin interfaceTransmittable- Throws:
java.io.IOException
-
loadObject
public void loadObject(java.io.DataInputStream dis) throws java.io.IOException- Specified by:
loadObjectin interfaceTransmittable- Throws:
java.io.IOException
-
-