Package 

Class Pose2D

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public double x
      public double y
      public double w
    • Constructor Summary

      Constructors 
      Constructor Description
      Pose2D() Constructs a new instance of the class.
      Pose2D(Vector2D vector, double w) Constructs a new instance of the class.
      Pose2D(double x, double y, double w) Constructs a new instance of the class.
    • Method Summary

      Modifier and Type Method Description
      void add(Pose2D other) Add another pose to this one.
      void subtract(Pose2D other) Subtract another pose from this one.
      void divide(Pose2D other) Divide this pose by another one.
      double magnitude() Retrieves the pose magnitude (length)
      double magnitudeXY() Retrieves the pose magnitude on the XY dimensions(length)
      void normalizeXY() Normalizes the XY components.
      void normalizeComponents(double xNorm, double yNorm, double wNorm) Normalize individual components.
      void scaleXY(double factor) Scales the XY components.
      void limitMagnitude(double epsilonMin, double minMagnitude, double maxMagnitude) Limits the pose magnitude to a maximum value.
      void rotateXY(double angleRadians) Rotates the X and Y pose components by a given angle.
      void constrainWTo2PIRads() Update the value of w to make sure it is between 0° and 360°.
      void constrainWToPIRads() Update the value of w to make sure it is between -180° and 180°.
      double angleXY() Calculates the angle of the XY pose.
      void copyFrom(Pose2D other) Copies another pose values into this one.
      Pose2D clone() Makes a copy of this object.
      static Pose2D zero() Helper method for create a new Pose2D (which is set to zero).
      boolean equals(Object other) Compares this object with another one.
      String toString() Returns a String representation of this object.
      String toStringDegrees()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Pose2D

        Pose2D()
        Constructs a new instance of the class.
      • Pose2D

        Pose2D(Vector2D vector, double w)
        Constructs a new instance of the class.
        Parameters:
        vector - 2D vector.
        w - w value.
      • Pose2D

        Pose2D(double x, double y, double w)
        Constructs a new instance of the class.
        Parameters:
        x - x value.
        y - y value.
        w - w value.
    • Method Detail

      • add

         void add(Pose2D other)

        Add another pose to this one.

        Parameters:
        other - pose to add to this one.
      • subtract

         void subtract(Pose2D other)

        Subtract another pose from this one.

        Parameters:
        other - pose to subtract from this one.
      • divide

         void divide(Pose2D other)

        Divide this pose by another one.

        Parameters:
        other - pose to divide this one from.
      • magnitude

         double magnitude()

        Retrieves the pose magnitude (length)

      • magnitudeXY

         double magnitudeXY()

        Retrieves the pose magnitude on the XY dimensions(length)

      • normalizeXY

         void normalizeXY()

        Normalizes the XY components.

      • normalizeComponents

         void normalizeComponents(double xNorm, double yNorm, double wNorm)

        Normalize individual components.

      • scaleXY

         void scaleXY(double factor)

        Scales the XY components.

      • limitMagnitude

         void limitMagnitude(double epsilonMin, double minMagnitude, double maxMagnitude)

        Limits the pose magnitude to a maximum value.

        Parameters:
        maxMagnitude - max allowed magnitude
      • rotateXY

         void rotateXY(double angleRadians)

        Rotates the X and Y pose components by a given angle.

        Parameters:
        angleRadians - rotation angle in radians.
      • constrainWTo2PIRads

         void constrainWTo2PIRads()

        Update the value of w to make sure it is between 0° and 360°.

      • constrainWToPIRads

         void constrainWToPIRads()

        Update the value of w to make sure it is between -180° and 180°.

      • angleXY

         double angleXY()

        Calculates the angle of the XY pose.

      • copyFrom

         void copyFrom(Pose2D other)

        Copies another pose values into this one.

        Parameters:
        other - other value.
      • zero

        @NonNull() static Pose2D zero()

        Helper method for create a new Pose2D (which is set to zero).

      • equals

         boolean equals(Object other)

        Compares this object with another one.

        Parameters:
        other - other object to be compared.