Enum Class POVDirection

java.lang.Object
java.lang.Enum<POVDirection>
org.wpilib.driverstation.POVDirection
All Implemented Interfaces:
Serializable, Comparable<POVDirection>, Constable

public enum POVDirection extends Enum<POVDirection>
A controller POV direction.
  • Enum Constant Details

    • CENTER

      public static final POVDirection CENTER
      POV center.
    • UP

      public static final POVDirection UP
      POV up.
    • UP_RIGHT

      public static final POVDirection UP_RIGHT
      POV up right.
    • DOWN_RIGHT

      public static final POVDirection DOWN_RIGHT
      POV down right.
    • DOWN

      public static final POVDirection DOWN
      POV down.
    • DOWN_LEFT

      public static final POVDirection DOWN_LEFT
      POV down left.
    • LEFT

      public static final POVDirection LEFT
      POV left.
    • UP_LEFT

      public static final POVDirection UP_LEFT
      POV up left.
  • Field Details

    • value

      public final byte value
      The corresponding HAL value.
  • Method Details

    • values

      public static POVDirection[] 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

      public static POVDirection valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • of

      public static POVDirection of(byte value)
      Converts a byte value into a POVDirection enum value.
      Parameters:
      value - The byte value to convert.
      Returns:
      The corresponding POVDirection enum value.
      Throws:
      IllegalArgumentException - If value does not correspond to a POVDirection.
    • getAngle

      public Optional<Rotation2d> getAngle()
      Gets the angle of a POVDirection.
      Returns:
      The angle clockwise from straight up, or Optional.empty() if this POVDirection is CENTER.