Package frc.robot.systems
Class ShooterFSMSystem
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreate FSMSystem and initialize to starting state.ShooterFSMSystem(Drivetrain driveSystem, IntakeFSMSystem intakeSystem) Create FSMSystem and initialize to starting state. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateTargetFlyspeed(edu.wpi.first.math.geometry.Pose2d target) Calculate needed values to shoot in specific targets.booleanChecks if the target flywheel speed matches the actual flywheel speed within margin of error.protected ShooterFSMSystem.ShooterFSMStateGet the next state for the FSM based on inputs.voidreset()Reset the current FSM state.voidUpdate the FSM state periodically based on inputs.Methods inherited from class frc.robot.systems.FSMSystem
getCurrentState, setCurrentState, watchForStatesCommand
-
Constructor Details
-
ShooterFSMSystem
public ShooterFSMSystem()Create FSMSystem 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. -
ShooterFSMSystem
Create FSMSystem 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. This also passes in the drivetrain to continuously update poses for shooter_prep and passer_prep.- Parameters:
driveSystem- The drive system to be used by our botintakeSystem- The intake system to be used by our bot
-
-
Method Details
-
isAtSpeed
public boolean isAtSpeed()Checks if the target flywheel speed matches the actual flywheel speed within margin of error.- Returns:
- Boolean statement whether or not it is at flywheel speed or not
-
reset
public void reset()Description copied from class:FSMSystemReset the current FSM state.- Specified by:
resetin classFSMSystem<ShooterFSMSystem.ShooterFSMState>
-
update
Description copied from class:FSMSystemUpdate the FSM state periodically based on inputs.- Specified by:
updatein classFSMSystem<ShooterFSMSystem.ShooterFSMState>- Parameters:
input- the input object
-
nextState
Description copied from class:FSMSystemGet the next state for the FSM based on inputs.- Specified by:
nextStatein classFSMSystem<ShooterFSMSystem.ShooterFSMState>- Parameters:
input- the input object- Returns:
- the next state
-
calculateTargetFlyspeed
public double calculateTargetFlyspeed(edu.wpi.first.math.geometry.Pose2d target) Calculate needed values to shoot in specific targets.- Parameters:
target- The pose we are targetting towards- Returns:
- A list holding the target's needed flywheel speed and hood angle in that order to make a pass
-