Class IntakeExtension
- All Implemented Interfaces:
Subsystem
The deploy is a rack-and-pinion driven by two independent motors: a left axis (this class, CAN
id 4, Clockwise_Positive) and a right axis (IntakeExtension.IntakeExtensionRight, CAN id 5,
CounterClockwise_Positive). Each side runs its own closed-loop position control rather than one
following the other, so a side that skips teeth on the rack can be driven on its own to resync.
Normal deploy/retract states command both axes to the same setpoint. The RESYNC state
re-establishes truth by driving each side independently into the fully-extended hard stop (using
a soft-limit-bypassing voltage), detecting the stall, and re-zeroing that side's encoder at
maxRotations. This recovers from a tooth skip, which otherwise leaves the motor encoder
reading a position the rack is no longer at.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classThe right deploy axis.static enumstatic enumNested classes/interfaces inherited from class Mechanism
Mechanism.Config, Mechanism.FollowerConfig -
Field Summary
Fields inherited from class Mechanism
followerMotors, motor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRight()frc.robot.subsystems.intakeExtension.IntakeExtension.IntakeExtensionSimgetSim()booleanWhether the most recent resync has finished homing both sides.voidperiodic()Called once per scheduler loop.voidRuns a full resync: drives both sides into the extended hard stop, re-zeros each, then returns the subsystem toSTOPPED.voidsetBrakeMode(boolean isInBrake) Sets brake mode on both deploy axes.voidvoidMethods inherited from class Mechanism
aboveCurrent, aboveDegrees, abovePercentage, aboveRotations, aboveVelocityRPM, all, applyCurrentLimit, atCurrent, atDegrees, atPercentage, atRotations, atTargetPosition, atVelocityRPM, belowCurrent, belowDegrees, belowPercentage, belowRotations, belowVelocityRPM, checkAvgCurrent, checkMaxCurrent, checkMinThresholdCurrent, clampToSoftLimits, clearTrackingStop, coastMode, degreesToRotations, ensureBrakeMode, getCurrentCommandName, getFollowerMotors, getInputs, getLatencyCompensatedPositionDegrees, getLatencyCompensatedPositionRotations, getMotor, getName, getPositionDegrees, getPositionDegreesUncached, getPositionPercentage, getPositionRotations, getStatorCurrent, getSupplyCurrent, getTarget, getTemp, getVelocityRPM, getVelocityTargetRPS, getVoltage, hasSoftLimits, isAtRotations, isAttached, isAtTargetPosition, isMotorConnected, isPositionLost, isPositionWritePending, isTrackingStopped, logBatteryUsage, logDiagnostics, logDiagnostics, motorResetThisLoop, moveToDegrees, moveToPercentage, moveToRotations, percentToRotations, refreshSignalsOncePerLoop, 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, simulateReboot, simulationPeriodic, softLimitsNeedReboot, stop, tareMotor, toggleReverseSoftLimit, toggleSupplyCurrentLimit, toggleTorqueCurrentLimit, updateInputsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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- Parameters:
isInBrake-trueto set brake mode;falseto set coast mode
-
setWantedState
-
isResyncComplete
public boolean isResyncComplete()Whether the most recent resync has finished homing both sides. -
resyncCommand
Runs a full resync: drives both sides into the extended hard stop, re-zeros each, then returns the subsystem toSTOPPED.- Returns:
- a command that completes once both sides are re-zeroed
-
periodic
-
simulationInit
public void simulationInit() -
getConfig
-
getSim
public frc.robot.subsystems.intakeExtension.IntakeExtension.IntakeExtensionSim getSim() -
getRight
-