Package frc.robot.systems
Class ClimberFSMSystem
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionClimberFSMSystem(Optional<IntakeFSMSystem> intakeFSMSystem) Create ClimberFSMSystem and initialize to starting state. -
Method Summary
Modifier and TypeMethodDescriptioncom.ctre.phoenix6.configs.TalonFXConfigurationGet the TalonFXConfiguration for the climber motors.doubleGet the Left motor voltage in volts.doubleGet the motor position in rotations.doubleGet the motor velocity in rotations per second.doubleGet the Right motor voltage in volts.protected ClimberFSMSystem.ClimberFSMStateGet the next state for the FSM based on inputs.voidreset()Reset this system to its start state.voidUpdate FSM based on new inputs.voidUpdate logging values for this system.Methods inherited from class frc.robot.systems.FSMSystem
getCurrentState, setCurrentState, watchForStatesCommand
-
Constructor Details
-
ClimberFSMSystem
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:
resetin classFSMSystem<ClimberFSMSystem.ClimberFSMState>
-
update
Update FSM based on new inputs. This function only calls the FSM state specific handlers.- Specified by:
updatein classFSMSystem<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
Description copied from class:FSMSystemGet the next state for the FSM based on inputs.- Specified by:
nextStatein classFSMSystem<ClimberFSMSystem.ClimberFSMState>- Parameters:
input- the input object- Returns:
- the next state
-