Package frc.robot.systems
Class ClimberFSMSystem
java.lang.Object
frc.robot.systems.ClimberFSMSystem
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreate ClimberFSMSystem and initialize to starting state. -
Method Summary
Modifier and TypeMethodDescriptionReturn current FSM state.boolean
Indicates whether the climber position is in the range for being CLIMBED.boolean
Indicates whether the climber position is in the range for being EXTENDED.boolean
Indicates whether the climber position is in the range for being STOWED.void
reset()
Reset this system to its start state.void
Set the state of the FSM.void
update
(TeleopInput input) Update FSM based on new inputs.void
Updates the logging for the climber system.
-
Constructor Details
-
ClimberFSMSystem
public 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.
-
-
Method Details
-
getCurrentState
Return 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 enabled.
-
update
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 for the climber system. -
setState
Set the state of the FSM.- Parameters:
state
- The state to set the FSM to.
-
isClimberStowed
public boolean isClimberStowed()Indicates whether the climber position is in the range for being STOWED.- Returns:
- if the climber is STOWED
-
isClimberExtended
public boolean isClimberExtended()Indicates whether the climber position is in the range for being EXTENDED.- Returns:
- if the climber is EXTENDED
-
isClimberClimbed
public boolean isClimberClimbed()Indicates whether the climber position is in the range for being CLIMBED.- Returns:
- if the climber is CLIMBED
-