Package org.team1126.lib.math
Class FieldInfo
java.lang.Object
org.team1126.lib.math.FieldInfo
Retrieves information about the playing field from an AprilTag field
layout. By default,
AprilTagFields.kDefaultField is used.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpecifies the direction in which the field is symmetric. -
Method Summary
Modifier and TypeMethodDescriptionstatic edu.wpi.first.apriltag.AprilTagFieldLayoutReturns the current field's AprilTag layout.static doublelength()Returns the length (X-axis) of the field in meters.static voidsetLayout(edu.wpi.first.apriltag.AprilTagFieldLayout layout, FieldInfo.SymmetryType symmetryType) Sets a new AprilTag layout to retrieve field information from.static voidsetLayout(edu.wpi.first.apriltag.AprilTagFields field) Loads a new AprilTag layout to retrieve field information from.static voidsetLayout(String resourcePath, FieldInfo.SymmetryType symmetryType) Loads a new AprilTag layout to retrieve field information from.static FieldInfo.SymmetryTypeReturns the direction in which the field is symmetric.static doublewidth()Returns the width (Y-axis) of the field in meters.
-
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
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
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.
-