Class Head

All Implemented Interfaces:
Sendable, Subsystem

public class Head extends SubsystemBase
Shooter and intake.
  • Constructor Details

    • Head

      public Head()
      Creates a new Head.
  • Method Details

    • periodic

      public void periodic()
    • intakePieceCommand

      public Command intakePieceCommand()
      Intakes a piece and stops.
      Returns:
      Command to run
    • outtakePieceCommand

      public Command outtakePieceCommand()
      Outtakes a piece and stops.
      Returns:
      Command to run
    • shootCommand

      public Command shootCommand()
      Shoots.
      Returns:
      Command to run
    • spinDownShooter

      public void spinDownShooter()
      Stops the shooter.
      Implementation Note:
      This removes power from the motors, allowing them to spin down freely and reducing the shock on the mechanism, so the shooter will take some time to spin down after calling this method.
    • getShooterSpeed

      public double getShooterSpeed()
      Gets the speed of the bottom shooter motor.
      Returns:
      Motor velocity in RPM
    • getShooterSetPoint

      public double getShooterSetPoint()
      Gets the current setpoint of the shooter.
      Returns:
      Setpoint in RPM
    • spinUpShooterCommand

      public Command spinUpShooterCommand(double rpm)
      Spins up the shooter to a given speed.
      Parameters:
      rpm - New speed in RPM
      Returns:
      Command to run
    • spinDownShooterCommand

      public Command spinDownShooterCommand()
      Spins down the shooter.
      Returns:
      command to run
    • isReadyToShoot

      public boolean isReadyToShoot()
      Checks if the shooter speed is within the range to shoot.
      Returns:
      Is the shooter ready to shoot?
    • isNoteWithinAlignmentSensor

      public boolean isNoteWithinAlignmentSensor()
      Gets the value of the alignment sensor.
      Returns:
      Is the note in the alignment sensor?
    • isNoteWithinShootingSensor

      public boolean isNoteWithinShootingSensor()
      Gets the value of the shooting position sensor.
      Returns:
      Is the note in the position to shoot?
    • toggleBrakeModeCommand

      public Command toggleBrakeModeCommand()
      Toggles brake mode on the intake motor.
      Returns:
      Command to run
    • enableBrakeModeCommand

      public Command enableBrakeModeCommand()
      Enables brake mode on the intake motor. Called on enable to ensure the intake is in brake mode for the match.
      Returns:
      Command to run