Package frc.lib.util
Class FieldConstants
java.lang.Object
frc.lib.util.FieldConstants
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)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Each corner of the speaker *static final class
Staging locations for each note -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Translation2d
static AprilTagFieldLayout
static double
static Translation3d
static Translation3d
static double
static double
static double
static double
static double
static Translation3d
static Translation3d
static double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Pose2d
allianceFlip
(Pose2d pose) Flips a pose to the correct side of the field based on the current alliance color.static Rotation2d
allianceFlip
(Rotation2d rotation) Flips a pose to the correct side of the field based on the current alliance color.static Translation2d
allianceFlip
(Translation2d pose) Flips a pose to the correct side of the field based on the current alliance color.
-
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
-
topRightSpeaker
-
topLeftSpeaker
-
bottomRightSpeaker
-
bottomLeftSpeaker
-
centerSpeaker
public static double centerSpeaker -
aprilTagWidth
public static double aprilTagWidth -
aprilTags
-
-
Constructor Details
-
FieldConstants
public FieldConstants()
-
-
Method Details
-
allianceFlip
Flips a pose to the correct side of the field based on the current alliance color. By default, all translations and poses inFieldConstants
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
Flips a pose to the correct side of the field based on the current alliance color. By default, all translations and poses inFieldConstants
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
Flips a pose to the correct side of the field based on the current alliance color. By default, all translations and poses inFieldConstants
are stored with the origin at the rightmost point on the BLUE ALLIANCE wall.- Parameters:
rotation
- Initial Pose- Returns:
- Rotation2d flipped to Red Alliance
-