Class ShooterFSMSystem


public class ShooterFSMSystem extends FSMSystem<ShooterFSMSystem.ShooterFSMState>
  • 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

      public ShooterFSMSystem(Drivetrain driveSystem, IntakeFSMSystem intakeSystem)
      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 bot
      intakeSystem - 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: FSMSystem
      Reset the current FSM state.
      Specified by:
      reset in class FSMSystem<ShooterFSMSystem.ShooterFSMState>
    • update

      public void update(Input input)
      Description copied from class: FSMSystem
      Update the FSM state periodically based on inputs.
      Specified by:
      update in class FSMSystem<ShooterFSMSystem.ShooterFSMState>
      Parameters:
      input - the input object
    • nextState

      protected ShooterFSMSystem.ShooterFSMState nextState(Input input)
      Description copied from class: FSMSystem
      Get the next state for the FSM based on inputs.
      Specified by:
      nextState in class FSMSystem<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