Package frc.robot.subsystems
Class Flyboi
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.Flyboi
- All Implemented Interfaces:
edu.wpi.first.wpilibj.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
public class Flyboi
extends edu.wpi.first.wpilibj2.command.SubsystemBase
The shooter, composed of a single flywheel.
-
Field Summary
Fields Modifier and Type Field Description com.revrobotics.CANEncoderleftEncodercom.revrobotics.CANEncoderrightEncoderdoublewheelSpeed -
Constructor Summary
Constructors Constructor Description Flyboi() -
Method Summary
Modifier and Type Method Description doublegetPower()voidinitDefaultCommand()voidsetShootVoltage(double speed)Spins wheel motors at a certain speed by setting its desired voltage.voidspinWheel(double speed)Spins wheel motors.voidstopWheel()Stops wheel motors.Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
-
Field Details
-
leftEncoder
public com.revrobotics.CANEncoder leftEncoder -
rightEncoder
public com.revrobotics.CANEncoder rightEncoder -
wheelSpeed
public double wheelSpeed
-
-
Constructor Details
-
Flyboi
public Flyboi()
-
-
Method Details
-
initDefaultCommand
public void initDefaultCommand() -
spinWheel
public void spinWheel(double speed)Spins wheel motors. Recommended to usesetShootVoltageinstead.- Parameters:
speed- The speed to set the flywheel to (-1 to 1).
-
stopWheel
public void stopWheel()Stops wheel motors. -
getPower
public double getPower()- Returns:
- The velocity of the flywheel as found by the left flywheel encoder (around -1 to 1).
-
setShootVoltage
public void setShootVoltage(double speed)Spins wheel motors at a certain speed by setting its desired voltage. This will attempt to keep the flywheel velocity at a little above the velocity input, according togetPower. The actual velocity will fluctuate a little, but will attempt to stay at this voltage no matter the battery level.- Parameters:
speed- The speed to set the flywheel to (around -1 to 1).
-