Package frc.robot.subsystems
Class Head
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.Head
Shooter and intake.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionEnables brake mode on the intake motor.double
Gets the speed of the bottom shooter motor.double
Gets the current setpoint of the shooter.double
Gets the speed of the top shooter motor.Intakes a piece and stops.boolean
Gets the value of the alignment sensor.boolean
Gets the value of the shooting position sensor.boolean
Checks if the shooter speed is within the range to shoot.Outtakes a piece and stops.void
periodic()
Shoot()
Shoots and then stops the shooter.Shoot
(boolean stopShooter) Shoots.Spins down the shooter.SpinUpShooter
(double rpm) Spins up the shooter to a given speed.Spins up the shooter to shoot from a certain shooting position.Starts intaking.Starts outtaking.Stops the intake.void
Stops the shooter.Toggles brake mode on the intake motor.Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
Head
public Head()Creates a new Head.
-
-
Method Details
-
periodic
public void periodic() -
StartIntake
Starts intaking.- Returns:
- command to run
-
StartOutake
Starts outtaking.- Returns:
- command to run
-
StopIntake
Stops the intake.- Returns:
- command to run
-
IntakePiece
Intakes a piece and stops.- Returns:
- command to run
-
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
Spins up the shooter to a given speed.- Parameters:
rpm
- new speed in RPM- Returns:
- command to run
-
SpinUpShooter
Spins up the shooter to shoot from a certain shooting position.- Parameters:
position
- position to shoot from- Returns:
- command to run
-
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
Shoots and then stops the shooter.- Returns:
- command to run
-
Shoot
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
Toggles brake mode on the intake motor.- Returns:
- command to run
-
EnableBrakeMode
Enables brake mode on the intake motor.- Returns:
- command to run
-