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, degrees
volts - output while homing, toward the stop (negative)
stallDegPerSec - the hood is stalled while slower than this, deg/s
stallSeconds - how long it must stay stalled to count as on the stop
timeoutSeconds - how long an attempt may run before giving up
nearHomeDeg - 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 Details

    • Params

      public Params(double stopDeg, double volts, double stallDegPerSec, double stallSeconds, double timeoutSeconds, double nearHomeDeg)
      Creates an instance of a Params record class.
      Parameters:
      stopDeg - the value for the stopDeg record component
      volts - the value for the volts record component
      stallDegPerSec - the value for the stallDegPerSec record component
      stallSeconds - the value for the stallSeconds record component
      timeoutSeconds - the value for the timeoutSeconds record component
      nearHomeDeg - the value for the nearHomeDeg record component
  • Method Details

    • fm

      public static HoodHoming.Params 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

      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.
    • stopDeg

      public double stopDeg()
      Returns the value of the stopDeg record component.
      Returns:
      the value of the stopDeg record component
    • volts

      public double volts()
      Returns the value of the volts record component.
      Returns:
      the value of the volts record component
    • stallDegPerSec

      public double stallDegPerSec()
      Returns the value of the stallDegPerSec record component.
      Returns:
      the value of the stallDegPerSec record component
    • stallSeconds

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

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

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