Class ElevatorFSMSystem

java.lang.Object
frc.robot.systems.ElevatorFSMSystem

public class ElevatorFSMSystem extends Object
  • Constructor Details

    • ElevatorFSMSystem

      public ElevatorFSMSystem(FunnelFSMSystem funnelFSMSystem)
      Create ElevatorFSMSystem and initialize to starting state. Also perform any one-time initialization or configuration of hardware required. Note the constructor is called only once when the robot boots.
      Parameters:
      funnelFSMSystem - the funnel FSM.
  • Method Details

    • getCurrentState

      public ElevatorFSMSystem.ElevatorFSMState getCurrentState()
      Get the current FSM state.
      Returns:
      current FSM state
    • reset

      public void reset()
      Reset this system to its start state. This may be called from mode init when the robot is enabled. Note this is distinct from the one-time initialization in the constructor as it may be called multiple times in a boot cycle, Ex. if the robot is enabled, disabled, then reenabled.
    • update

      public void update(TeleopInput input)
      Update FSM based on new inputs. This function only calls the FSM state specific handlers.
      Parameters:
      input - Global TeleopInput if robot in teleop mode or null if the robot is in autonomous mode.
    • updateLogging

      public void updateLogging()
      Updates the logging information for the elevator system.
    • isElevatorAtL2

      public boolean isElevatorAtL2()
      Is elevator at L2 boolean accessor.
      Returns:
      whether or not elevator is at L2.
    • isElevatorAtL3

      public boolean isElevatorAtL3()
      Is elevator at L3 boolean accessor.
      Returns:
      whether or not elevator is at L3.
    • isElevatorAtL4

      public boolean isElevatorAtL4()
      Is elevator at L4 boolean accessor.
      Returns:
      whether or not elevator is at L4.
    • isElevatorAtGround

      public boolean isElevatorAtGround()
      Is elevator at ground boolean accessor.
      Returns:
      whether or not elevator is at ground.
    • elevatorGroundCommand

      public edu.wpi.first.wpilibj2.command.Command elevatorGroundCommand()
      Creates a Command to move the elevator to the ground position.
      Returns:
      A new elevator ground command.
    • elevatorL2Command

      public edu.wpi.first.wpilibj2.command.Command elevatorL2Command()
      Creates a Command to move the elevator to the L2 position.
      Returns:
      A new elevator L2 command.
    • elevatorL3Command

      public edu.wpi.first.wpilibj2.command.Command elevatorL3Command()
      Creates a Command to move the elevator to the L3 position.
      Returns:
      A new elevator L3 command.
    • elevatorL4Command

      public edu.wpi.first.wpilibj2.command.Command elevatorL4Command()
      Creates a Command to move the elevator to the L4 position.
      Returns:
      A new elevator L4 command.
    • waitCommand

      public edu.wpi.first.wpilibj2.command.Command waitCommand()
      Creates a Command that waits for a specified duration.
      Returns:
      A new wait command.