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.CANEncoder leftEncoder  
    com.revrobotics.CANEncoder rightEncoder  
    double wheelSpeed  
  • Constructor Summary

    Constructors 
    Constructor Description
    Flyboi()  
  • Method Summary

    Modifier and Type Method Description
    double getPower()  
    void initDefaultCommand()  
    void setShootVoltage​(double speed)
    Spins wheel motors at a certain speed by setting its desired voltage.
    void spinWheel​(double speed)
    Spins wheel motors.
    void stopWheel()
    Stops wheel motors.

    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.wpilibj.Sendable

    addChild, setName, setName, setName

    Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem

    getCurrentCommand, getDefaultCommand, periodic, register, setDefaultCommand, simulationPeriodic
  • Field Details

  • Constructor Details

  • Method Details

    • initDefaultCommand

      public void initDefaultCommand()
    • spinWheel

      public void spinWheel​(double speed)
      Spins wheel motors. Recommended to use setShootVoltage instead.
      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 to getPower. 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).