Package choreo.util
Enum Class AllianceFlipUtil.Flipper
- All Implemented Interfaces:
Serializable
,Comparable<AllianceFlipUtil.Flipper>
,Constable
- Enclosing class:
- AllianceFlipUtil
The flipper to use for flipping coordinates.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionX becomes fieldLength - x, leaves the y coordinate unchanged, and heading becomes PI - heading.X becomes fieldLength - x, Y becomes fieldWidth - y, and heading becomes PI - heading. -
Method Summary
Modifier and TypeMethodDescriptionabstract double
flipHeading
(double heading) Flips the heading.abstract double
flipX
(double x) Flips the X coordinate.abstract double
flipY
(double y) Flips the Y coordinate.static AllianceFlipUtil.Flipper
Returns the enum constant of this class with the specified name.static AllianceFlipUtil.Flipper[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MIRRORED
X becomes fieldLength - x, leaves the y coordinate unchanged, and heading becomes PI - heading. -
ROTATE_AROUND
X becomes fieldLength - x, Y becomes fieldWidth - y, and heading becomes PI - heading.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
flipX
Flips the X coordinate.- Parameters:
x
- The X coordinate to flip.- Returns:
- The flipped X coordinate.
-
flipY
Flips the Y coordinate.- Parameters:
y
- The Y coordinate to flip.- Returns:
- The flipped Y coordinate.
-
flipHeading
Flips the heading.- Parameters:
heading
- The heading to flip.- Returns:
- The flipped heading.
-