Package frc.lib.util

Class FieldConstants

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

public class FieldConstants extends Object
Field Constants
  • Field Details

    • fieldLength

      public static final double fieldLength
    • fieldWidth

      public static final double fieldWidth
    • tapeWidth

      public static final double tapeWidth
    • blueOrigin

      public static final Pose3d blueOrigin
    • redOrigin

      public static final Pose3d redOrigin
    • aprilTags

      public static final Map<Integer,Pose3d> aprilTags
      AprilTag locations (do not flip for red alliance)
  • Constructor Details

    • FieldConstants

      public FieldConstants()
  • Method Details

    • allianceFlip

      public static Translation2d allianceFlip(Translation2d translation)
      Flips a translation 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.
    • 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
    • fieldSdf

      public static double fieldSdf(Translation2d p, double radius)
      Find the minimum distance from a circular robot to an obstacle on the field.
      Parameters:
      p - Starting translation
      radius - Radius
      Returns:
      field SDF
    • fieldSdf

      public static double fieldSdf(Translation2d p)
      Find the minimum distance from a point to an obstacle on the field.