Class FieldInfo

java.lang.Object
org.team1126.lib.math.FieldInfo

public final class FieldInfo extends Object
Retrieves information about the playing field from an AprilTag field layout. By default, AprilTagFields.kDefaultField is used.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Specifies the direction in which the field is symmetric.
  • Method Summary

    Modifier and Type
    Method
    Description
    static edu.wpi.first.apriltag.AprilTagFieldLayout
    Returns the current field's AprilTag layout.
    static double
    Returns the length (X-axis) of the field in meters.
    static void
    setLayout(edu.wpi.first.apriltag.AprilTagFieldLayout layout, FieldInfo.SymmetryType symmetryType)
    Sets a new AprilTag layout to retrieve field information from.
    static void
    setLayout(edu.wpi.first.apriltag.AprilTagFields field)
    Loads a new AprilTag layout to retrieve field information from.
    static void
    setLayout(String resourcePath, FieldInfo.SymmetryType symmetryType)
    Loads a new AprilTag layout to retrieve field information from.
    Returns the direction in which the field is symmetric.
    static double
    Returns the width (Y-axis) of the field in meters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • setLayout

      public static void setLayout(edu.wpi.first.apriltag.AprilTagFields field)
      Loads a new AprilTag layout to retrieve field information from. This method should be called before all other user code.
      Parameters:
      field - The loadable AprilTag field layout.
    • setLayout

      public static void setLayout(String resourcePath, FieldInfo.SymmetryType symmetryType)
      Loads a new AprilTag layout to retrieve field information from. This method should be called before all other user code.
      Parameters:
      resourcePath - The absolute path of the resource.
      symmetryType - The field's symmetry type.
    • setLayout

      public static void setLayout(edu.wpi.first.apriltag.AprilTagFieldLayout layout, FieldInfo.SymmetryType symmetryType)
      Sets a new AprilTag layout to retrieve field information from. This method should be called before all other user code.
      Parameters:
      layout - The AprilTag field layout.
      symmetryType - The field's symmetry type.
    • length

      public static double length()
      Returns the length (X-axis) of the field in meters.
    • width

      public static double width()
      Returns the width (Y-axis) of the field in meters.
    • symmetryType

      public static FieldInfo.SymmetryType symmetryType()
      Returns the direction in which the field is symmetric.
    • aprilTags

      public static edu.wpi.first.apriltag.AprilTagFieldLayout aprilTags()
      Returns the current field's AprilTag layout.