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 TypeMethodDescriptionvoid
void
Disables only the locking servo.void
Disables only the plunger servo.void
Disables both the plunger and locking servos.void
void
Enables only the locking servo.void
Enables only the plunger servo.void
Enables both the plunger and locking servos.boolean
Gets the state of the cage limit switches.boolean
Gets the state of the cage limit switches.void
lockCage()
Locks the climbing cage using the locking servo.void
void
periodic()
Periodic update function that logs climber inputs.void
setPlungerToAngle
(Angle angle) Sets the plunger servo to a specific angle.void
Sets the plunger servo to its plunge position (0 degrees).void
Sets the plunger servo to its receive position (180 degrees).void
Sets the plunger servo to its stow position (270 degrees).void
Unlocks the climbing cage using the locking servo.void
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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).
-