Class FieldTargetConfig

java.lang.Object
frc.robot.shared.field.FieldTargetConfig

public class FieldTargetConfig extends Object
Field target positions used for zone-aware turret tracking.

All positions are defined from the Blue alliance perspective in meters. Red alliance coordinates are computed at runtime by mirroring the X-axis. Embed this config in the turret subsystem config so positions are loaded from the deploy JSON. Divider coordinates are derived from AprilTag positions on the field structure: AprilTag 26 marks the field center and AprilTag 23 marks the neutral zone boundary.

  • Field Details

    • fieldLengthMeters

      public double fieldLengthMeters
      Total field length along the X-axis in meters.
    • fieldWidthMeters

      public double fieldWidthMeters
      Total field width along the Y-axis in meters.
    • allianceZoneBoundaryXMeters

      public double allianceZoneBoundaryXMeters
      X-coordinate boundary that separates the alliance zone from the neutral zone in meters.

      When the robot's X position is less than this value (Blue alliance), the robot is considered in the alliance zone. For Red alliance, the boundary is mirrored to fieldLength minus this value. Derived from AprilTag 23's X position (4.574 m).

    • fieldCenterDividerYMeters

      public double fieldCenterDividerYMeters
      Y-coordinate of the field center divider in meters.

      This is the lateral midline of the field, derived from AprilTag 26's Y position (4.021 m). Use it for determining whether the robot is on the left or right side of the field.

    • hubPositionXMeters

      public double hubPositionXMeters
      X-coordinate of the Alliance Hub target in meters (Blue alliance perspective).

      Derived from the midpoint between AprilTag 26 (x=4.008 m) and AprilTag 20 (x=5.215 m), which sit on opposite sides of the hub.

    • hubPositionYMeters

      public double hubPositionYMeters
      Y-coordinate of the Alliance Hub target in meters, aligned with the field center divider.
    • leftZonePositionXMeters

      public double leftZonePositionXMeters
      X-coordinate of the left zone rally point in meters (Blue alliance perspective).
    • leftZonePositionYMeters

      public double leftZonePositionYMeters
      Y-coordinate of the left zone rally point in meters.
    • rightZonePositionXMeters

      public double rightZonePositionXMeters
      X-coordinate of the right zone rally point in meters (Blue alliance perspective).
    • rightZonePositionYMeters

      public double rightZonePositionYMeters
      Y-coordinate of the right zone rally point in meters.
  • Constructor Details

    • FieldTargetConfig

      public FieldTargetConfig()