Package frc.lib.util

Class FieldConstants

java.lang.Object
frc.lib.util.FieldConstants

public class FieldConstants extends Object
Contains various field dimensions and useful reference points. Dimensions are in meters, and sets of corners start in the lower left moving clockwise. All units in Meters

All translations and poses are stored with the origin at the rightmost point on the BLUE ALLIANCE wall.

Length refers to the x direction (as described by wpilib)
Width refers to the y direction (as described by wpilib)

  • Field Details

    • fieldLength

      public static double fieldLength
    • fieldWidth

      public static double fieldWidth
    • wingX

      public static double wingX
    • podiumX

      public static double podiumX
    • startingLineX

      public static double startingLineX
    • ampCenter

      public static Translation2d ampCenter
    • topRightSpeaker

      public static Translation3d topRightSpeaker
    • topLeftSpeaker

      public static Translation3d topLeftSpeaker
    • bottomRightSpeaker

      public static Translation3d bottomRightSpeaker
    • bottomLeftSpeaker

      public static Translation3d bottomLeftSpeaker
    • centerSpeaker

      public static double centerSpeaker
    • aprilTagWidth

      public static double aprilTagWidth
    • aprilTags

      public static AprilTagFieldLayout aprilTags
  • Constructor Details

    • FieldConstants

      public FieldConstants()
  • Method Details

    • allianceFlip

      public static Pose2d allianceFlip(Pose2d pose)
      Flips a pose to the correct side of the field based on the current alliance color. By default, all translations and poses in FieldConstants are stored with the origin at the rightmost point on the BLUE ALLIANCE wall.
      Parameters:
      pose - Initial Pose
      Returns:
      Pose2d flipped to Red Alliance
    • allianceFlip

      public static Translation2d allianceFlip(Translation2d pose)
      Flips a pose to the correct side of the field based on the current alliance color. By default, all translations and poses in FieldConstants are stored with the origin at the rightmost point on the BLUE ALLIANCE wall.
      Parameters:
      pose - Initial Pose
      Returns:
      Pose2d flipped to Red Alliance
    • allianceFlip

      public static Rotation2d allianceFlip(Rotation2d rotation)
      Flips a pose to the correct side of the field based on the current alliance color. By default, all translations and poses in FieldConstants are stored with the origin at the rightmost point on the BLUE ALLIANCE wall.
      Parameters:
      rotation - Initial Pose
      Returns:
      Rotation2d flipped to Red Alliance