Package frc.lib.math

Class AllianceFlipUtil

java.lang.Object
frc.lib.math.AllianceFlipUtil

public class AllianceFlipUtil extends Object
Utility functions for flipping from the blue to red alliance.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    apply(double xCoordinate)
     
    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.
    static edu.wpi.first.math.geometry.Pose2d
    apply(edu.wpi.first.math.geometry.Pose2d pose, boolean flip)
     
    static edu.wpi.first.math.geometry.Rotation2d
    apply(edu.wpi.first.math.geometry.Rotation2d rotation)
    Flips a rotation based on the current alliance color.
    static edu.wpi.first.math.geometry.Rotation2d
    apply(edu.wpi.first.math.geometry.Rotation2d rotation, boolean flip)
     
    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.
    static edu.wpi.first.math.geometry.Translation2d
    apply(edu.wpi.first.math.geometry.Translation2d translation, boolean flip)
     
    static edu.wpi.first.math.geometry.Translation3d
    apply(edu.wpi.first.math.geometry.Translation3d translation3d)
     
    static boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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()