Package frc.robot.subsystems.cellmech
Class Shooter
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.SubsystemBase
-
- frc.robot.subsystems.cellmech.Shooter
-
- All Implemented Interfaces:
edu.wpi.first.wpilibj.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
public class Shooter extends edu.wpi.first.wpilibj2.command.SubsystemBaseRobot Shooter subsystem
-
-
Field Summary
Fields Modifier and Type Field Description static Shooters_instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ShootergetInstance()Get the instance of ShooterdoublegetOutput()doublegetVelocityFromLimelight()voidhandleUnjam(boolean newState)Handle unjamming the power cellsbooleanisInPosition()booleanisSpunUp()Check if the flywheel has spun upvoidperiodic()voidsetInPosition(boolean inPosition)voidsetOutputPercent(double val)voidsetVelocity(double val)voidstop()-
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
-
-
-
-
Field Detail
-
s_instance
public static Shooter s_instance
-
-
Method Detail
-
getInstance
public static Shooter getInstance()
Get the instance of Shooter- Returns:
- Shooter Instance
-
periodic
public void periodic()
-
handleUnjam
public void handleUnjam(boolean newState)
Handle unjamming the power cells- Parameters:
newState- Is this state new?
-
setOutputPercent
public void setOutputPercent(double val)
-
setVelocity
public void setVelocity(double val)
-
stop
public void stop()
-
isSpunUp
public boolean isSpunUp()
Check if the flywheel has spun up- Returns:
- Has spun up?
-
getOutput
public double getOutput()
-
setInPosition
public void setInPosition(boolean inPosition)
- Parameters:
inPosition- Is the bot in position to score?
-
isInPosition
public boolean isInPosition()
- Returns:
- Is the bot in position to score?
-
getVelocityFromLimelight
public double getVelocityFromLimelight()
- Returns:
- Desired flywheel velocity in RPM based on distance to target.
-
-