Record Class HoodHoming.Params
java.lang.Object
java.lang.Record
frc.robot.subsystems.hood.HoodHoming.Params
- Record Components:
stopDeg- hood angle at the bottom stop, degreesvolts- output while homing, toward the stop (negative)stallDegPerSec- the hood is stalled while slower than this, deg/sstallSeconds- how long it must stay stalled to count as on the stoptimeoutSeconds- how long an attempt may run before giving upnearHomeDeg- re-home on stow once this close to the stop, degrees
- Enclosing class:
HoodHoming
public static record HoodHoming.Params(double stopDeg, double volts, double stallDegPerSec, double stallSeconds, double timeoutSeconds, double nearHomeDeg)
extends Record
Homing constants.
-
Constructor Summary
ConstructorsConstructorDescriptionParams(double stopDeg, double volts, double stallDegPerSec, double stallSeconds, double timeoutSeconds, double nearHomeDeg) Creates an instance of aParamsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static HoodHoming.Paramsfm()FM's numbers.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thenearHomeDegrecord component.doubleReturns the value of thestallDegPerSecrecord component.doubleReturns the value of thestallSecondsrecord component.doublestopDeg()Returns the value of thestopDegrecord component.doubleReturns the value of thetimeoutSecondsrecord component.final StringtoString()Returns a string representation of this record class.doublevolts()Returns the value of thevoltsrecord component.
-
Constructor Details
-
Params
public Params(double stopDeg, double volts, double stallDegPerSec, double stallSeconds, double timeoutSeconds, double nearHomeDeg) Creates an instance of aParamsrecord class.- Parameters:
stopDeg- the value for thestopDegrecord componentvolts- the value for thevoltsrecord componentstallDegPerSec- the value for thestallDegPerSecrecord componentstallSeconds- the value for thestallSecondsrecord componenttimeoutSeconds- the value for thetimeoutSecondsrecord componentnearHomeDeg- the value for thenearHomeDegrecord component
-
-
Method Details
-
fm
FM's numbers. CALIBRATE on the bench (README, "Hood homing").- Stop 9 deg: the angle FM's code has always seeded at boot and sent home to.
- -1.5 V: about 0.6 V goes to the 25 A kS (Kraken FOC is about 0.025 ohm), the rest moves the hood at roughly 50 deg/s, so the 40 deg of travel takes under a second. Stalled, the 60 A stator limit caps the push. 6328 homes at -2 V.
- Stalled under 4 deg/s for 0.2 s: 4 deg/s is a tenth of the homing speed, and 0.2 s covers the hood breaking away from rest and the velocity signal's lag, so a hood that starts above the stop is not taken as stalled before it moves.
- Timeout 3 s: three times the full-travel time.
- Re-home on stow within 2 deg: a stow re-home then corrects at most a couple of degrees, and costs about 0.25 s at the stop.
- Returns:
- the constants
-
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. -
stopDeg
-
volts
-
stallDegPerSec
public double stallDegPerSec()Returns the value of thestallDegPerSecrecord component.- Returns:
- the value of the
stallDegPerSecrecord component
-
stallSeconds
public double stallSeconds()Returns the value of thestallSecondsrecord component.- Returns:
- the value of the
stallSecondsrecord component
-
timeoutSeconds
public double timeoutSeconds()Returns the value of thetimeoutSecondsrecord component.- Returns:
- the value of the
timeoutSecondsrecord component
-
nearHomeDeg
public double nearHomeDeg()Returns the value of thenearHomeDegrecord component.- Returns:
- the value of the
nearHomeDegrecord component
-