Skip to content

Shooter

Zayd Abualfellat edited this page May 5, 2020 · 8 revisions

Shooter

Shoots the ball to the tower using velocity, measured in encoder ticks per 100 ms.

Motors

The shooter currently uses 2 motors: the leftShootMotor and the rightShootMotor. They are currently not officially assigned to any ports.

Periodic

The periodic of the subsystem is mainly used for putting useful information on Shuffleboard.

Here is a list of all the information put on the Shuffleboard:

  • Shooter Motor 1 Velocity
  • Shooter Motor 2 Velocity
  • Shooter Motor 1 Temperature
  • Shooter Motor 2 Temperature
  • Whether either motor is above 70 degrees Celsius
    • It is programmed that if the shooter motors ever reach such a high temperature, they will not be able to be controlled.
  • If the shooter is in a certain range of velocity
  • The value of an infrared sensor on the shooter that records whether a ball is in front of it or not

During debug mode, the Shuffleboard also records the highest motor velocity reached in the current run.

*Note: velocity is measured in encoder ticks per 100 milliseconds (ms)

Methods

Set Shooter Speed

The setShooterSpeeed(double velocity) method is used to set the speed of the motors. The parameter velocity is the target speed (in encoder ticks per 100 ms) for the motors to reach using PIDs.

Stop Shooter

The stopShooter() method stops the shooter motors by setting their power input to 0. This safely slows the motors from high speeds.

Calculate RPM

The int calculateLeftRPM() and int calculateRightRPM() methods calculate and return the RPM of the motors using their current speed.


Commands

Start Shooter

Starts the shooter motors and gets them up to a certain speed. The subsystem that is using the command is required as the first parameter. A velocity is required as a second parameter.

Stop Shooter

Stops the shooter motors and gets them up to a certain speed. The subsystem that is using the command is required as the parameter.


Back to top

Clone this wiki locally