Class IntakeExtension
java.lang.Object
frc.spectrumLib.mechanism.Mechanism
frc.robot.subsystems.intakeExtension.IntakeExtension
- All Implemented Interfaces:
Subsystem
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classRight deploy axis, a standaloneMechanismrather than a follower so it can be driven on its own during a resync.static enumstatic enumNested classes/interfaces inherited from class frc.spectrumLib.mechanism.Mechanism
Mechanism.Config, Mechanism.FollowerConfig, Mechanism.RpmLog -
Field Summary
Fields inherited from class frc.spectrumLib.mechanism.Mechanism
followerMotors, motor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfrc.robot.subsystems.intakeExtension.IntakeExtension.IntakeExtensionSimgetSim()booleanWhether the most recent resync has finished homing both sides.voidperiodic()Called once per scheduler loop.voidDrives both sides into the extended hard stop and re-zeroes each one as it stalls, then returns the subsystem to STOPPED.voidsetBrakeMode(boolean isInBrake) Sets brake mode on both deploy axes.voidvoidMethods inherited from class frc.spectrumLib.mechanism.Mechanism
aboveCurrent, aboveDegrees, abovePercentage, aboveRotations, aboveVelocityRPM, applyCurrentLimit, atCurrent, atDegrees, atPercentage, atRotations, atTargetPosition, atVelocityRPM, belowCurrent, belowDegrees, belowPercentage, belowRotations, belowVelocityRPM, checkAvgCurrent, checkMaxCurrent, checkMinThresholdCurrent, coastMode, degreesToRotations, ensureBrakeMode, getCurrentCommandName, getFollowerMotors, getLatencyCompensatedPositionDegrees, getLatencyCompensatedPositionRotations, getMotor, getName, getPositionDegrees, getPositionPercentage, getPositionRotations, getStatorCurrent, getSupplyCurrent, getTarget, getTemp, getVelocityRPM, getVelocityTargetRPS, getVoltage, isAtRotations, isAttached, isAtTargetPosition, isMotorConnected, logBatteryUsage, logDiagnostics, logDiagnostics, logStandard, moveToDegrees, moveToPercentage, moveToRotations, percentToRotations, rotationsToDegrees, rotationsToPercent, runCurrentLimits, runFocRotations, runningDefaultCommand, runPercentage, runStop, runTorqueCurrentFoc, runVelocity, runVelocityTcFocRPM, runVoltage, runVoltageNoSoftLimit, setCurrentLimits, setDynMMPositionFoc, setDynMMPositionVoltage, setMMPosition, setMMPosition, setMMPositionFoc, setMMVelocityFOC, setMotorPosition, setPercentOutput, setPosition, setPositionFocWithVelocity, setPositionWithVelocity, setTorqueCurrentFoc, setVelocity, setVelocityRPM, setVelocityTCFOCrpm, setVelocityTorqueCurrentFOC, setVoltageOutput, setVoltageOutputNoSoftLimit, simulationPeriodic, stop, tareMotor, toggleReverseSoftLimit, toggleSupplyCurrentLimit, toggleTorqueCurrentLimitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, startEnd, startRun
-
Constructor Details
-
IntakeExtension
-
-
Method Details
-
resetCurrentPositionToMax
public void resetCurrentPositionToMax() -
resetCurrentPositionToMaxCommand
-
resetToInitialPos
-
setBrakeMode
public void setBrakeMode(boolean isInBrake) Sets brake mode on both deploy axes.- Overrides:
setBrakeModein classMechanism
-
setWantedState
-
isResyncComplete
public boolean isResyncComplete()Whether the most recent resync has finished homing both sides. -
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:MechanismCalled once per scheduler loop. Subclasses override this for their state machine, telemetry and sensor work. -
simulationInit
public void simulationInit() -
getConfig
-
getSim
public frc.robot.subsystems.intakeExtension.IntakeExtension.IntakeExtensionSim getSim()
-