Package org.team1126.lib.math
Class FieldFlip
java.lang.Object
org.team1126.lib.math.FieldFlip
Utility class for flipping field locations across lines of symmetry.
FieldInfo is utilized to retrieve field dimensions.-
Method Summary
Modifier and TypeMethodDescriptionstatic edu.wpi.first.math.geometry.Pose2doverDiagonal(edu.wpi.first.math.geometry.Pose2d pose) Flips the providedPose2dover the field's diagonal (i.e.static edu.wpi.first.math.geometry.Rotation2doverDiagonal(edu.wpi.first.math.geometry.Rotation2d rotation) Flips the providedRotation2dover the field's diagonal (i.e.static edu.wpi.first.math.geometry.Translation2doverDiagonal(edu.wpi.first.math.geometry.Translation2d translation) Flips the providedTranslation2dover the field's diagonal (i.e.static edu.wpi.first.math.geometry.Pose2doverLength(edu.wpi.first.math.geometry.Pose2d pose) Flips the providedPose2dover the length of the field (i.e.static edu.wpi.first.math.geometry.Rotation2doverLength(edu.wpi.first.math.geometry.Rotation2d rotation) Flips the providedRotation2dover the length of the field (i.e.static edu.wpi.first.math.geometry.Translation2doverLength(edu.wpi.first.math.geometry.Translation2d translation) Flips the providedTranslation2dover the length of the field (i.e.static edu.wpi.first.math.geometry.Pose2doverWidth(edu.wpi.first.math.geometry.Pose2d pose) Flips the providedPose2dover the width of the field (i.e.static edu.wpi.first.math.geometry.Rotation2doverWidth(edu.wpi.first.math.geometry.Rotation2d rotation) Flips the providedRotation2dover the width of the field (i.e.static edu.wpi.first.math.geometry.Translation2doverWidth(edu.wpi.first.math.geometry.Translation2d translation) Flips the providedTranslation2dover the width of the field (i.e.
-
Method Details
-
overLength
public static edu.wpi.first.math.geometry.Translation2d overLength(edu.wpi.first.math.geometry.Translation2d translation) Flips the providedTranslation2dover the length of the field (i.e. hamburger style).- Parameters:
translation- The translation to flip.
-
overLength
public static edu.wpi.first.math.geometry.Rotation2d overLength(edu.wpi.first.math.geometry.Rotation2d rotation) Flips the providedRotation2dover the length of the field (i.e. hamburger style).- Parameters:
rotation- The rotation to flip.
-
overLength
public static edu.wpi.first.math.geometry.Pose2d overLength(edu.wpi.first.math.geometry.Pose2d pose) Flips the providedPose2dover the length of the field (i.e. hamburger style).- Parameters:
pose- The pose to flip.
-
overWidth
public static edu.wpi.first.math.geometry.Translation2d overWidth(edu.wpi.first.math.geometry.Translation2d translation) Flips the providedTranslation2dover the width of the field (i.e. hotdog style).- Parameters:
translation- The translation to flip.
-
overWidth
public static edu.wpi.first.math.geometry.Rotation2d overWidth(edu.wpi.first.math.geometry.Rotation2d rotation) Flips the providedRotation2dover the width of the field (i.e. hotdog style).- Parameters:
rotation- The rotation to flip.
-
overWidth
public static edu.wpi.first.math.geometry.Pose2d overWidth(edu.wpi.first.math.geometry.Pose2d pose) Flips the providedPose2dover the width of the field (i.e. hotdog style).- Parameters:
pose- The pose to flip.
-
overDiagonal
public static edu.wpi.first.math.geometry.Translation2d overDiagonal(edu.wpi.first.math.geometry.Translation2d translation) Flips the providedTranslation2dover the field's diagonal (i.e. rotated 180deg around the field's center).- Parameters:
translation- The translation to flip.
-
overDiagonal
public static edu.wpi.first.math.geometry.Rotation2d overDiagonal(edu.wpi.first.math.geometry.Rotation2d rotation) Flips the providedRotation2dover the field's diagonal (i.e. rotated 180deg around the field's center).- Parameters:
rotation- The rotation to flip.
-
overDiagonal
public static edu.wpi.first.math.geometry.Pose2d overDiagonal(edu.wpi.first.math.geometry.Pose2d pose) Flips the providedPose2dover the field's diagonal (i.e. rotated 180deg around the field's center).- Parameters:
pose- The pose to flip.
-