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.SubsystemBase
Robot Shooter subsystem
-
-
Field Summary
Fields Modifier and Type Field Description static Shooter
s_instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Shooter
getInstance()
Get the instance of Shooterdouble
getOutput()
double
getVelocityFromLimelight()
void
handleUnjam(boolean newState)
Handle unjamming the power cellsboolean
isInPosition()
boolean
isSpunUp()
Check if the flywheel has spun upvoid
periodic()
void
setInPosition(boolean inPosition)
void
setOutputPercent(double val)
void
setVelocity(double val)
void
stop()
-
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.
-
-