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, degreeshoodKeepDeg- largest hood error to keep feeding at, degreeshoodStartMaxDegPerSec- fastest the hood may be moving to start a volley, deg/saimKeepScale- how much wider the keep-feeding heading tolerance is than the start onesettleSeconds- how long every start check must hold before the volley startstimeoutSeconds- 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 Summary
ConstructorsConstructorDescriptionTolerances(double hoodStartDeg, double hoodKeepDeg, double hoodStartMaxDegPerSec, double aimKeepScale, double settleSeconds, double timeoutSeconds) Creates an instance of aTolerancesrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theaimKeepScalerecord component.final booleanIndicates whether some other object is "equal to" this one.static ShotGate.Tolerancesfm()FM's numbers.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thehoodKeepDegrecord component.doubleReturns the value of thehoodStartDegrecord component.doubleReturns the value of thehoodStartMaxDegPerSecrecord component.doubleReturns the value of thesettleSecondsrecord component.doubleReturns the value of thetimeoutSecondsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Tolerances
public Tolerances(double hoodStartDeg, double hoodKeepDeg, double hoodStartMaxDegPerSec, double aimKeepScale, double settleSeconds, double timeoutSeconds) Creates an instance of aTolerancesrecord class.- Parameters:
hoodStartDeg- the value for thehoodStartDegrecord componenthoodKeepDeg- the value for thehoodKeepDegrecord componenthoodStartMaxDegPerSec- the value for thehoodStartMaxDegPerSecrecord componentaimKeepScale- the value for theaimKeepScalerecord componentsettleSeconds- the value for thesettleSecondsrecord componenttimeoutSeconds- the value for thetimeoutSecondsrecord component
-
-
Method Details
-
fm
FM's numbers. Each is the offseason bot's, or FM's own constant, unless noted; CALIBRATE againstShot/*andShotLog/*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
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
hoodStartDeg
public double hoodStartDeg()Returns the value of thehoodStartDegrecord component.- Returns:
- the value of the
hoodStartDegrecord component
-
hoodKeepDeg
public double hoodKeepDeg()Returns the value of thehoodKeepDegrecord component.- Returns:
- the value of the
hoodKeepDegrecord component
-
hoodStartMaxDegPerSec
public double hoodStartMaxDegPerSec()Returns the value of thehoodStartMaxDegPerSecrecord component.- Returns:
- the value of the
hoodStartMaxDegPerSecrecord component
-
aimKeepScale
public double aimKeepScale()Returns the value of theaimKeepScalerecord component.- Returns:
- the value of the
aimKeepScalerecord component
-
settleSeconds
public double settleSeconds()Returns the value of thesettleSecondsrecord component.- Returns:
- the value of the
settleSecondsrecord component
-
timeoutSeconds
public double timeoutSeconds()Returns the value of thetimeoutSecondsrecord component.- Returns:
- the value of the
timeoutSecondsrecord component
-