Package frc.lib.util
Class FieldConstants
java.lang.Object
frc.lib.util.FieldConstants
Field Constants
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDimensions for community and charging station, including the tape.static final classDimensions for grids and nodesstatic final classDimensions for loading zone and substations, including the tapestatic final classLocations of staged game pieces -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Pose2dallianceFlip(Pose2d pose) Flips a pose to the correct side of the field based on the current alliance color.static Translation2dallianceFlip(Translation2d translation) Flips a translation to the correct side of the field based on the current alliance color.static doubleFind the minimum distance from a point to an obstacle on the field.static doublefieldSdf(Translation2d p, double radius) Find the minimum distance from a circular robot to an obstacle on the field.
-
Field Details
-
fieldLength
public static final double fieldLength -
fieldWidth
public static final double fieldWidth -
tapeWidth
public static final double tapeWidth -
blueOrigin
-
redOrigin
-
aprilTags
AprilTag locations (do not flip for red alliance)
-
-
Constructor Details
-
FieldConstants
public FieldConstants()
-
-
Method Details
-
allianceFlip
Flips a translation to the correct side of the field based on the current alliance color. By default, all translations and poses inFieldConstantsare stored with the origin at the rightmost point on the BLUE ALLIANCE wall. -
allianceFlip
Flips a pose to the correct side of the field based on the current alliance color. By default, all translations and poses inFieldConstantsare stored with the origin at the rightmost point on the BLUE ALLIANCE wall.- Parameters:
pose- Initial Pose- Returns:
- Pose2d flipped to Red Alliance
-
fieldSdf
Find the minimum distance from a circular robot to an obstacle on the field.- Parameters:
p- Starting translationradius- Radius- Returns:
- field SDF
-
fieldSdf
Find the minimum distance from a point to an obstacle on the field.
-