implement ShootAtHighGoal and add some helper methods
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.java
1 package org.usfirst.frc.team3501.robot.subsystems;
2
3 import org.usfirst.frc.team3501.robot.Constants;
4
5 import edu.wpi.first.wpilibj.DoubleSolenoid;
6 import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
7 import edu.wpi.first.wpilibj.command.Subsystem;
8
9 /***
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.
14 *
15 * @author superuser
16 *
17 */
18
19 public class Shooter extends Subsystem {
20 private DoubleSolenoid catapult1, catapult2;
21
22 public Shooter() {
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);
29 }
30
31 // Catapult Commands
32 public void fireCatapult() {
33 catapult1.set(Constants.Shooter.SHOOT);
34 catapult2.set(Constants.Shooter.SHOOT);
35 }
36
37 public void resetCatapult() {
38 catapult1.set(Constants.Shooter.RESET);
39 catapult2.set(Constants.Shooter.RESET);
40 }
41
42 public Value getCatapult1State() {
43 return catapult1.get();
44 }
45
46 public Value getCatapult2State() {
47 return catapult2.get();
48 }
49
50 @Override
51 protected void initDefaultCommand() {
52 }
53 }