Class GameField

java.lang.Object
xbot.common.subsystems.pose.GameField

@Singleton public class GameField extends Object
Represents the field the robot is on and provides helpers for transforming field coordinates.
  • Constructor Details

    • GameField

      @Inject public GameField(AprilTagFieldLayout fieldLayout, GameField.Symmetry symmetry)
      Creates a new GameField.
      Parameters:
      fieldLayout - The layout of the field.
      symmetry - The symmetry of the field.
  • Method Details

    • getFieldWidth

      public Distance getFieldWidth()
      Gets the width of the field.
      Returns:
      The width of the field.
    • getFieldLength

      public Distance getFieldLength()
      Gets the length of the field.
      Returns:
      The length of the field.
    • getSymmetry

      public GameField.Symmetry getSymmetry()
      Gets the symmetry of the field.
      Returns:
      The symmetry of the field.
    • getFieldCenter

      public Translation2d getFieldCenter()
      Gets the center of the field.
      Returns:
      The center of the field. Distances are in meters.
    • getMirroredTranslation

      public Translation2d getMirroredTranslation(Translation2d original)
      Gets the mirrored translation of a given translation per the field symmetry.
      Parameters:
      original - The original translation. Distances are in meters.
      Returns:
      The mirrored translation. Distances are in meters.
    • getMirroredRotation

      public Rotation2d getMirroredRotation(Rotation2d original)
      Gets the mirrored rotation of a given rotation per the field symmetry.
      Parameters:
      original - The original rotation.
      Returns:
      The mirrored rotation.
    • getMirroredPose

      public Pose2d getMirroredPose(Pose2d original)
      Gets the mirrored pose of a given pose per the field symmetry.
      Parameters:
      original - The original pose. Distances are in meters.
      Returns:
      The mirrored pose. Distances are in meters.