Class ClimberSubsystem

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.alotobots.reefscape.subsystems.climber.ClimberSubsystem
All Implemented Interfaces:
Sendable, Subsystem

public class ClimberSubsystem extends SubsystemBase
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 Details

    • ClimberSubsystem

      public ClimberSubsystem(ClimberIO io)
      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

      public void setPlungerToAngle(Angle angle)
      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).