-
public class Pose2D
-
-
Method Summary
Modifier and Type Method Description voidadd(Pose2D other)Add another pose to this one. voidsubtract(Pose2D other)Subtract another pose from this one. voiddivide(Pose2D other)Divide this pose by another one. doublemagnitude()Retrieves the pose magnitude (length) doublemagnitudeXY()Retrieves the pose magnitude on the XY dimensions(length) voidnormalizeXY()Normalizes the XY components. voidnormalizeComponents(double xNorm, double yNorm, double wNorm)Normalize individual components. voidscaleXY(double factor)Scales the XY components. voidlimitMagnitude(double epsilonMin, double minMagnitude, double maxMagnitude)Limits the pose magnitude to a maximum value. voidrotateXY(double angleRadians)Rotates the X and Y pose components by a given angle. voidconstrainWTo2PIRads()Update the value of w to make sure it is between 0° and 360°. voidconstrainWToPIRads()Update the value of w to make sure it is between -180° and 180°. doubleangleXY()Calculates the angle of the XY pose. voidcopyFrom(Pose2D other)Copies another pose values into this one. Pose2Dclone()Makes a copy of this object. static Pose2Dzero()Helper method for create a new Pose2D (which is set to zero). booleanequals(Object other)Compares this object with another one. StringtoString()Returns a String representation of this object. StringtoStringDegrees()-
-
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.
-
equals
boolean equals(Object other)
Compares this object with another one.
- Parameters:
other- other object to be compared.
-
toStringDegrees
String toStringDegrees()
-
-
-
-