Class IntakeExtension

java.lang.Object
frc.spectrumLib.mechanism.Mechanism
frc.robot.subsystems.intakeExtension.IntakeExtension
All Implemented Interfaces:
Subsystem

public class IntakeExtension extends Mechanism
Rack-and-pinion fuel intake deploy, driven by two independent axes: the left, which is this class, and the right (IntakeExtension.IntakeExtensionRight). Each side runs its own closed-loop position control rather than one following the other, so a side that skips a tooth can be driven on its own to resync.

Resyncing drives each side into the fully extended hard stop and re-zeroes that side's encoder at maxRotations. A skipped tooth otherwise leaves the motor encoder reading a position the rack is no longer at.

  • Constructor Details

  • Method Details

    • resetCurrentPositionToMax

      public void resetCurrentPositionToMax()
    • resetCurrentPositionToMaxCommand

      public Command resetCurrentPositionToMaxCommand()
    • resetToInitialPos

      public Command resetToInitialPos()
    • setBrakeMode

      public void setBrakeMode(boolean isInBrake)
      Sets brake mode on both deploy axes.
      Overrides:
      setBrakeMode in class Mechanism
    • setWantedState

      public void setWantedState(IntakeExtension.WantedState state)
    • isResyncComplete

      public boolean isResyncComplete()
      Whether the most recent resync has finished homing both sides.
    • resyncCommand

      public Command resyncCommand()
      Drives both sides into the extended hard stop and re-zeroes each one as it stalls, then returns the subsystem to STOPPED. A homing timeout can end the command with a side that never stalled, and that side is then left where it stopped rather than re-zeroed.
      Returns:
      a command that ends once both sides are re-zeroed, or once the homing timeout hits
    • periodic

      public void periodic()
      Description copied from class: Mechanism
      Called once per scheduler loop. Subclasses override this for their state machine, telemetry and sensor work.
      Specified by:
      periodic in interface Subsystem
      Overrides:
      periodic in class Mechanism
    • simulationInit

      public void simulationInit()
    • getConfig

    • getSim

      public frc.robot.subsystems.intakeExtension.IntakeExtension.IntakeExtensionSim getSim()