1 package org
.usfirst
.frc
.team3501
.robot
.subsystems
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
;
5 import edu
.wpi
.first
.wpilibj
.DoubleSolenoid
;
6 import edu
.wpi
.first
.wpilibj
.DoubleSolenoid
.Value
;
7 import edu
.wpi
.first
.wpilibj
.command
.Subsystem
;
10 * The Shooter consists of a platform and wheel, each controlled by separate
11 * motors. The piston controlling the platform pushes the ball onto the wheel.
12 * The wheel is controlled by a motor, which is running before the ball is
13 * pushed onto the wheel. The spinning wheel propels the ball.
19 public class Shooter
extends Subsystem
{
20 private DoubleSolenoid catapult1
, catapult2
;
23 catapult1
= new DoubleSolenoid(Constants
.Shooter
.CATAPULT1_MODULE
,
24 Constants
.Shooter
.CATAPULT1_FORWARD
,
25 Constants
.Shooter
.CATAPULT1_REVERSE
);
26 catapult2
= new DoubleSolenoid(Constants
.Shooter
.CATAPULT2_MODULE
,
27 Constants
.Shooter
.CATAPULT2_FORWARD
,
28 Constants
.Shooter
.CATAPULT2_REVERSE
);
32 public void fireCatapult() {
33 catapult1
.set(Constants
.Shooter
.SHOOT
);
34 catapult2
.set(Constants
.Shooter
.SHOOT
);
37 // Retracts catapult pistons
38 public void resetCatapult() {
39 catapult1
.set(Constants
.Shooter
.RESET
);
40 catapult2
.set(Constants
.Shooter
.RESET
);
43 public Value
getCatapult1State() {
44 return catapult1
.get();
47 public Value
getCatapult2State() {
48 return catapult2
.get();
52 protected void initDefaultCommand() {