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()
    • StartIntake

      public Command StartIntake()
      Starts intaking.
      Returns:
      command to run
    • StartOutake

      public Command StartOutake()
      Starts outtaking.
      Returns:
      command to run
    • StopIntake

      public Command StopIntake()
      Stops the intake.
      Returns:
      command to run
    • IntakePiece

      public Command IntakePiece()
      Intakes a piece and stops.
      Returns:
      command to run
    • OutakePiece

      public Command OutakePiece()
      Outtakes a piece and stops.
      Returns:
      command to run
    • stopShooter

      public void stopShooter()
      Stops the shooter.
      Implementation Note:
      This removes power from the motors, allowing them to spin down freely, so the shooter will take some time to spin down after calling this method.
    • getShooterBottomSpeed

      public double getShooterBottomSpeed()
      Gets the speed of the bottom shooter motor.
      Returns:
      motor velocity
    • getShooterTopSpeed

      public double getShooterTopSpeed()
      Gets the speed of the top shooter motor.
      Returns:
      motor velocity
    • getShooterSetPoint

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

      public Command SpinUpShooter(double rpm)
      Spins up the shooter to a given speed.
      Parameters:
      rpm - new speed in RPM
      Returns:
      command to run
    • SpinUpShooter

      public Command SpinUpShooter(Constants.ShootingConstants.ShootingPosition position)
      Spins up the shooter to shoot from a certain shooting position.
      Parameters:
      position - position to shoot from
      Returns:
      command to run
    • SpinDownShooter

      public Command SpinDownShooter()
      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?
    • Shoot

      public Command Shoot()
      Shoots and then stops the shooter.
      Returns:
      command to run
    • Shoot

      public Command Shoot(boolean stopShooter)
      Shoots.
      Parameters:
      stopShooter - if true, shooter is spun down after shoot
      Returns:
      command to run
    • isNoteWithinSensor

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

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

      public Command ToggleBreakModes()
      Toggles brake mode on the intake motor.
      Returns:
      command to run
    • EnableBrakeMode

      public Command EnableBrakeMode()
      Enables brake mode on the intake motor.
      Returns:
      command to run