Package frc.robot.systems
Class FunnelFSMSystem
java.lang.Object
frc.robot.systems.FunnelFSMSystem
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreate a FunnelFSMSystem and initialize to starting state. -
Method Summary
Modifier and TypeMethodDescriptionReturn current FSM state.double
Returns the funnel outtake timer value.edu.wpi.first.wpilibj2.command.Command
Creates a Command to intake coral.boolean
Getter for the status of the funnel's break beam.edu.wpi.first.wpilibj2.command.Command
Creates a Command to close the funnel.void
reset()
Reset this system to its start state.void
update
(TeleopInput input) Update FSM based on new inputs.void
Calls all logging and telemetry to be updated periodically.
-
Constructor Details
-
FunnelFSMSystem
public FunnelFSMSystem()Create a FunnelFSMSystem 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 reenabled. -
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.
-
getOuttakeTimeElapsed
public double getOuttakeTimeElapsed()Returns the funnel outtake timer value.- Returns:
- amount of time the funnel has been opened.
-
updateLogging
public void updateLogging()Calls all logging and telemetry to be updated periodically. -
isHoldingCoral
public boolean isHoldingCoral()Getter for the status of the funnel's break beam. Public for access to elevator.- Returns:
- whether the limit is reached
-
intakeCoralCommand
public edu.wpi.first.wpilibj2.command.Command intakeCoralCommand()Creates a Command to intake coral.- Returns:
- A new intake coral command.
-
outtakeCoralCommand
public edu.wpi.first.wpilibj2.command.Command outtakeCoralCommand()Creates a Command to close the funnel.- Returns:
- A new funnel close command.
-