Record Class ShotGate.Tolerances

java.lang.Object
java.lang.Record
frc.robot.subsystems.ShotGate.Tolerances
Record Components:
hoodStartDeg - largest hood error to start a volley at, degrees
hoodKeepDeg - largest hood error to keep feeding at, degrees
hoodStartMaxDegPerSec - fastest the hood may be moving to start a volley, deg/s
aimKeepScale - how much wider the keep-feeding heading tolerance is than the start one
settleSeconds - how long every start check must hold before the volley starts
timeoutSeconds - how long the gate may hold a launch before feeding anyway
Enclosing class:
ShotGate

public static record ShotGate.Tolerances(double hoodStartDeg, double hoodKeepDeg, double hoodStartMaxDegPerSec, double aimKeepScale, double settleSeconds, double timeoutSeconds) extends Record
Gate tolerances.
  • Constructor Details

    • Tolerances

      public Tolerances(double hoodStartDeg, double hoodKeepDeg, double hoodStartMaxDegPerSec, double aimKeepScale, double settleSeconds, double timeoutSeconds)
      Creates an instance of a Tolerances record class.
      Parameters:
      hoodStartDeg - the value for the hoodStartDeg record component
      hoodKeepDeg - the value for the hoodKeepDeg record component
      hoodStartMaxDegPerSec - the value for the hoodStartMaxDegPerSec record component
      aimKeepScale - the value for the aimKeepScale record component
      settleSeconds - the value for the settleSeconds record component
      timeoutSeconds - the value for the timeoutSeconds record component
  • Method Details

    • fm

      public static ShotGate.Tolerances fm()
      FM's numbers. Each is the offseason bot's, or FM's own constant, unless noted; CALIBRATE against Shot/* and ShotLog/* from the first practice session.
      • Hood 1 deg to start, 3 to keep. The offseason bot started at 0.5; FM's hood moves on Motion Magic toward a target that moves with distance while shooting on the move, and the model moves about 0.5 deg per 15 cm, so 1 deg is about 30 cm of range.
      • And the hood moving under 20 deg/s to start. In the sim the hood overshoots a 3.5 deg move by 3 deg and swings back through the target at 35 deg/s; without this the volley opened on the way through, then chopped when the overshoot passed 3 deg. Shooting on the move the target itself moves a few deg/s at most.
      • Heading keep tolerance twice the start one (the offseason bot's turret was 2 to 6).
      • Settle 0.04 s: the offseason bot's three 20 ms loops, rounded to FM's 10 ms loop.
      • Timeout 1.0 s: longer than a spin-up from idle plus a half turn, short enough that an auto's 2.5 s launch window still has 1.5 s of feeding in the worst case.
      Returns:
      the tolerances
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hoodStartDeg

      public double hoodStartDeg()
      Returns the value of the hoodStartDeg record component.
      Returns:
      the value of the hoodStartDeg record component
    • hoodKeepDeg

      public double hoodKeepDeg()
      Returns the value of the hoodKeepDeg record component.
      Returns:
      the value of the hoodKeepDeg record component
    • hoodStartMaxDegPerSec

      public double hoodStartMaxDegPerSec()
      Returns the value of the hoodStartMaxDegPerSec record component.
      Returns:
      the value of the hoodStartMaxDegPerSec record component
    • aimKeepScale

      public double aimKeepScale()
      Returns the value of the aimKeepScale record component.
      Returns:
      the value of the aimKeepScale record component
    • settleSeconds

      public double settleSeconds()
      Returns the value of the settleSeconds record component.
      Returns:
      the value of the settleSeconds record component
    • timeoutSeconds

      public double timeoutSeconds()
      Returns the value of the timeoutSeconds record component.
      Returns:
      the value of the timeoutSeconds record component