Class ClimberFSMSystem


public class ClimberFSMSystem extends FSMSystem<ClimberFSMSystem.ClimberFSMState>
  • Constructor Details

    • ClimberFSMSystem

      public ClimberFSMSystem(Optional<IntakeFSMSystem> intakeFSMSystem)
      Create ClimberFSMSystem 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:
      intakeFSMSystem - the IntakeFSMSystem
  • Method Details

    • getConfig

      public com.ctre.phoenix6.configs.TalonFXConfiguration getConfig()
      Get the TalonFXConfiguration for the climber motors.
      Returns:
      TalonFXConfiguration for the climber motors
    • 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.
      Specified by:
      reset in class FSMSystem<ClimberFSMSystem.ClimberFSMState>
    • update

      public void update(Input input)
      Update FSM based on new inputs. This function only calls the FSM state specific handlers.
      Specified by:
      update in class FSMSystem<ClimberFSMSystem.ClimberFSMState>
      Parameters:
      input - Global Input if robot in teleop mode or null if the robot is in autonomous mode.
    • updateLogging

      public void updateLogging()
      Update logging values for this system.
    • getMotorPosition

      public double getMotorPosition()
      Get the motor position in rotations.
      Returns:
      motor position in rotations
    • getMotorVelocity

      public double getMotorVelocity()
      Get the motor velocity in rotations per second.
      Returns:
      motor velocity in rotations per second
    • getLeftMotorVoltage

      public double getLeftMotorVoltage()
      Get the Left motor voltage in volts.
      Returns:
      motor voltage in volts
    • getRightMotorVoltage

      public double getRightMotorVoltage()
      Get the Right motor voltage in volts.
      Returns:
      motor voltage in volts
    • nextState

      protected ClimberFSMSystem.ClimberFSMState nextState(Input input)
      Description copied from class: FSMSystem
      Get the next state for the FSM based on inputs.
      Specified by:
      nextState in class FSMSystem<ClimberFSMSystem.ClimberFSMState>
      Parameters:
      input - the input object
      Returns:
      the next state