Class 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.
    • 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​(java.io.DataOutputStream dos)
                        throws java.io.IOException
        Specified by:
        dumpObject in interface Transmittable
        Throws:
        java.io.IOException
      • loadObject

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