Class Elevator

All Implemented Interfaces:
Sendable, Subsystem

public class Elevator extends SubsystemBase
  • Constructor Details

    • Elevator

      public Elevator(RobotContainer robotContainer)
      Creates a new Elevator.
  • Method Details

    • periodic

      public void periodic()
      This method is responsible for they safety of the elevator and wrist.

      This uses the elevatorTarget and wristTarget to determine the target position of the elevator and wrist. If the elevator and wrist are both below their SAFE_MIN_POSITION they will collide. Whenever either one is below their SAFE_MIN_POSITION the other will be limited to the SAFE_MIN_POSITION.

    • setSpeedsCommand

      public Command setSpeedsCommand(DoubleSupplier elevatorSpeed, DoubleSupplier wristSpeed)
      A command to set the speeds of the elevator and wrist.
      Parameters:
      elevatorSpeed - The speed of the elevator as a percentage of max speed. [-1, 1]
      wristSpeed - The speed of the wrist as a percentage of max speed. [-1, 1]
      Returns:
      Command to run.
    • SetPositionCommand

      public Command SetPositionCommand(Constants.ArmPosition position)
      A command to set the elevator and wrist to a position.
      Parameters:
      position - The Constants.ArmPosition to set the elevator and wrist to.
      Returns:
      Command to run.
    • doNothing

      public Command doNothing()
      A command that does nothing. This command requires the elevator subsystem so it will kill any other command. This is used to let the drivers regain controll of the elevator if it is unable to reach its target.
      Returns:
      Command to run.
    • getElevatorTarget

      public double getElevatorTarget()
    • elevatorInit

      public void elevatorInit()