Package frc.robot.subsystems.climb
Class Climb
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.climb.Climb
Subsystem for the robot's climb mechanism.
Handles controlling the lift motor voltage and monitoring limit switches to prevent over-extension or damage to the mechanism.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHigh-level goals for the climb subsystem. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all faults and warnings.isDown()Returns a trigger that is true when the lower limit switch is triggered.booleanReturns whether or not the subsystem is healthyisUp()Returns a trigger that is true when the upper limit switch is triggered.lower()Returns a command to lower the climber until it hits the lower limit.voidperiodic()Updates hardware inputs, logs data, and updates status alerts.raise()Returns a command to raise the climber until it hits the upper limit.voidsetGoal(Climb.Goal goal) Sets the current requested goal for the climber.stop()Returns a command to stop the climber.Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods 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, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
Climb
Creates a new Climb subsystem.- Parameters:
io- The abstraction layer for the climb hardware.
-
-
Method Details
-
setGoal
Sets the current requested goal for the climber.- Parameters:
goal- The target goal for the climber.
-
periodic
public void periodic()Updates hardware inputs, logs data, and updates status alerts. -
isUp
Returns a trigger that is true when the upper limit switch is triggered.- Returns:
- The upper limit trigger.
-
isDown
Returns a trigger that is true when the lower limit switch is triggered.- Returns:
- The lower limit trigger.
-
raise
Returns a command to raise the climber until it hits the upper limit.- Returns:
- The raise command.
-
lower
Returns a command to lower the climber until it hits the lower limit.- Returns:
- The lower command.
-
stop
Returns a command to stop the climber.- Returns:
- The stop command.
-
isHealthy
public boolean isHealthy()Returns whether or not the subsystem is healthy -
clearFaults
public void clearFaults()Clears all faults and warnings.- Specified by:
clearFaultsin interfaceMonitored
-