Package frc.lib.math
Class AllianceFlipUtil
java.lang.Object
frc.lib.math.AllianceFlipUtil
Utility functions for flipping from the blue to red alliance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleapply(double xCoordinate) static edu.wpi.first.math.geometry.Pose2dapply(edu.wpi.first.math.geometry.Pose2d pose) Flips a pose to the correct side of the field based on the current alliance color.static edu.wpi.first.math.geometry.Pose2dapply(edu.wpi.first.math.geometry.Pose2d pose, boolean flip) static edu.wpi.first.math.geometry.Rotation2dapply(edu.wpi.first.math.geometry.Rotation2d rotation) Flips a rotation based on the current alliance color.static edu.wpi.first.math.geometry.Rotation2dapply(edu.wpi.first.math.geometry.Rotation2d rotation, boolean flip) static edu.wpi.first.math.geometry.Translation2dapply(edu.wpi.first.math.geometry.Translation2d translation) Flips a translation to the correct side of the field based on the current alliance color.static edu.wpi.first.math.geometry.Translation2dapply(edu.wpi.first.math.geometry.Translation2d translation, boolean flip) static edu.wpi.first.math.geometry.Translation3dapply(edu.wpi.first.math.geometry.Translation3d translation3d) static boolean
-
Constructor Details
-
AllianceFlipUtil
public AllianceFlipUtil()
-
-
Method Details
-
apply
public static double apply(double xCoordinate) -
apply
public static edu.wpi.first.math.geometry.Translation2d apply(edu.wpi.first.math.geometry.Translation2d translation) Flips a translation to the correct side of the field based on the current alliance color. -
apply
public static edu.wpi.first.math.geometry.Rotation2d apply(edu.wpi.first.math.geometry.Rotation2d rotation) Flips a rotation based on the current alliance color. -
apply
public static edu.wpi.first.math.geometry.Pose2d apply(edu.wpi.first.math.geometry.Pose2d pose) Flips a pose to the correct side of the field based on the current alliance color. -
apply
public static edu.wpi.first.math.geometry.Rotation2d apply(edu.wpi.first.math.geometry.Rotation2d rotation, boolean flip) -
apply
public static edu.wpi.first.math.geometry.Translation2d apply(edu.wpi.first.math.geometry.Translation2d translation, boolean flip) -
apply
public static edu.wpi.first.math.geometry.Pose2d apply(edu.wpi.first.math.geometry.Pose2d pose, boolean flip) -
apply
public static edu.wpi.first.math.geometry.Translation3d apply(edu.wpi.first.math.geometry.Translation3d translation3d) -
shouldFlip
public static boolean shouldFlip()
-