1 package org
.usfirst
.frc
.team3501
.robot
.subsystems
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
;
4 import org
.usfirst
.frc
.team3501
.robot
.MathLib
;
6 import com
.ctre
.CANTalon
;
8 import edu
.wpi
.first
.wpilibj
.command
.Subsystem
;
13 public class Intake
extends Subsystem
{
14 private static Intake intake
= null;
15 private CANTalon intakeWheel
;
16 public static final double INTAKE_SPEED
= 1;
17 public static final double REVERSE_SPEED
= -1;
19 private int intakeCameraFeed
= 1;
22 intakeWheel
= new CANTalon(Constants
.Intake
.INTAKE_ROLLER_PORT
);
26 * It gets the intake instance, and if intake has not been initialized, then
27 * it will be initialized.
31 public static Intake
getIntake() {
33 intake
= new Intake();
39 protected void initDefaultCommand() {
44 * Sets speed of intake wheel to input speed
49 private void setSpeed(double speed
) {
50 speed
= MathLib
.restrictToRange(speed
, -1.0, 1.0);
51 intakeWheel
.set(speed
);
55 * Runs the intake wheel at the set intake speed.
57 public void runIntake() {
58 setSpeed(INTAKE_SPEED
);
62 * Stops the intake wheel by setting intake wheel's speed to 0.
64 public void stopIntake() {
68 public int getIntakeCameraFeed() {
69 return this.intakeCameraFeed
;
72 public void setIntakeCameraFeed(int intakeCamFeed
) {
73 this.intakeCameraFeed
= intakeCamFeed
;
77 * Purpose is to release all balls from the ball container to the outside of
78 * the robot. Reverses intake wheel by setting wheel speed to reverse speed.
81 public void runReverseIntake() {
82 setSpeed(REVERSE_SPEED
);