Class ClimberSubsystem
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.alotobots.reefscape.subsystems.climber.ClimberSubsystem
A subsystem that controls the robot's climbing mechanism. This subsystem manages two servos: - A
plunger servo that can move between receive (180°) and plunge (0°) positions - A locking servo
that secures the climbing cage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidDisables only the locking servo.voidDisables only the plunger servo.voidDisables both the plunger and locking servos.voidvoidEnables only the locking servo.voidEnables only the plunger servo.voidEnables both the plunger and locking servos.booleanGets the state of the cage limit switches.booleanGets the state of the cage limit switches.voidlockCage()Locks the climbing cage using the locking servo.voidvoidperiodic()Periodic update function that logs climber inputs.voidsetPlungerToAngle(Angle angle) Sets the plunger servo to a specific angle.voidSets the plunger servo to its plunge position (0 degrees).voidSets the plunger servo to its receive position (180 degrees).voidSets the plunger servo to its stow position (270 degrees).voidUnlocks the climbing cage using the locking servo.voidMethods 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, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
ClimberSubsystem
Creates a new ClimberSubsystem.- Parameters:
io- The hardware interface for the climber
-
-
Method Details
-
periodic
public void periodic()Periodic update function that logs climber inputs. Called once per scheduler run. -
getCageSwitches
public boolean getCageSwitches()Gets the state of the cage limit switches.- Returns:
- true if the cage switches are activated
-
getCageSwitchesRaw
public boolean getCageSwitchesRaw()Gets the state of the cage limit switches.- Returns:
- true if the cage switches are activated
-
enableServos
public void enableServos()Enables both the plunger and locking servos. -
disableServos
public void disableServos()Disables both the plunger and locking servos. -
setPlungerToAngle
Sets the plunger servo to a specific angle. 0 degrees is the plunge position, 180 degrees is the receive position.- Parameters:
angle- The desired angle for the plunger servo
-
lockCage
public void lockCage()Locks the climbing cage using the locking servo. -
unlockCage
public void unlockCage()Unlocks the climbing cage using the locking servo. -
lockElevator
public void lockElevator() -
unlockElevator
public void unlockElevator() -
enablePlungerServo
public void enablePlungerServo()Enables only the plunger servo. -
enableLockingServo
public void enableLockingServo()Enables only the locking servo. -
disablePlungerServo
public void disablePlungerServo()Disables only the plunger servo. -
disableLockingServo
public void disableLockingServo()Disables only the locking servo. -
enableElevatorLockingServo
public void enableElevatorLockingServo() -
disableElevatorLockingServo
public void disableElevatorLockingServo() -
setPlungerToReceive
public void setPlungerToReceive()Sets the plunger servo to its receive position (180 degrees). -
setPlungerToStow
public void setPlungerToStow()Sets the plunger servo to its stow position (270 degrees). -
setPlungerToPlunge
public void setPlungerToPlunge()Sets the plunger servo to its plunge position (0 degrees).
-