Class Hopper

  • All Implemented Interfaces:
    edu.wpi.first.wpilibj.Sendable, edu.wpi.first.wpilibj2.command.Subsystem

    public class Hopper
    extends edu.wpi.first.wpilibj2.command.SubsystemBase
    Robot hopper subsystem
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Hopper s_instance  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void forceCellCount​(int count)
      Force-override the internal power cell counter
      int getCellCount()  
      static Hopper getInstance()
      Get the instance of Hopper
      boolean getTopLineBreak()  
      void interruptShooting()
      Stop shooting and get remaining cells back to the bottom
      boolean isDone()  
      void manuallyControlBelt​(double speed)
      manually control the belt
      void modifyCellCount​(int changeAmount)  
      void moveCellsToBottom()
      moves cells to bottom
      void periodic()  
      void startIntake()
      Set the hopper to intake
      void startRumble()  
      void stop()
      Stop the hopper
      void supplyCellsToShooter()
      Supply cells to shooter until there are none left
      boolean topLineBreakState()  
      void unjam()
      Set the hopper to unjam
      void unjamUp()
      Set the hopper to unjam up
      • 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, register, setDefaultCommand
    • Field Detail

      • s_instance

        public static Hopper s_instance
    • Method Detail

      • getInstance

        public static Hopper getInstance()
        Get the instance of Hopper
        Returns:
        Hopper Instance
      • periodic

        public void periodic()
      • getTopLineBreak

        public boolean getTopLineBreak()
        Returns:
        state of the top line break sensor
      • getCellCount

        public int getCellCount()
        Returns:
        current amount of cells in the hopper
      • modifyCellCount

        public void modifyCellCount​(int changeAmount)
        Parameters:
        changeAmount - amount to increase or decrease the cell count by
      • startRumble

        public void startRumble()
      • isDone

        public boolean isDone()
        Returns:
        wether or not the hopper has completed it's actions (if it is idle or not)
      • topLineBreakState

        public boolean topLineBreakState()
        Returns:
        state of the top line break sensor
      • interruptShooting

        public void interruptShooting()
        Stop shooting and get remaining cells back to the bottom
      • supplyCellsToShooter

        public void supplyCellsToShooter()
        Supply cells to shooter until there are none left
      • unjam

        public void unjam()
        Set the hopper to unjam
      • unjamUp

        public void unjamUp()
        Set the hopper to unjam up
      • startIntake

        public void startIntake()
        Set the hopper to intake
      • stop

        public void stop()
        Stop the hopper
      • moveCellsToBottom

        public void moveCellsToBottom()
        moves cells to bottom
      • manuallyControlBelt

        public void manuallyControlBelt​(double speed)
        manually control the belt
        Parameters:
        speed - speed to set the belt to
      • forceCellCount

        public void forceCellCount​(int count)
        Force-override the internal power cell counter
        Parameters:
        count - New cell count [0-5]