Package frc.robot.subsystems.mechanisms
Class Head
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.mechanisms.Head
Shooter and intake.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEnables brake mode on the intake motor.double
Gets the current setpoint of the shooter.double
Gets the speed of the bottom 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()
Shoots.void
Stops the shooter.Spins down the shooter.spinUpShooterCommand
(double rpm) Spins up the shooter to a given speed.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() -
intakePieceCommand
Intakes a piece and stops.- Returns:
Command
to run
-
outtakePieceCommand
Outtakes a piece and stops.- Returns:
Command
to run
-
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
Spins up the shooter to a given speed.- Parameters:
rpm
- New speed in RPM- Returns:
Command
to run
-
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
Toggles brake mode on the intake motor.- Returns:
Command
to run
-
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
-