1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RecordData
;
4 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.Test1
;
5 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.Test2
;
6 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.Test3
;
8 import edu
.wpi
.first
.wpilibj
.Joystick
;
9 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
10 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
13 public static Joystick leftJoystick
;
14 public static Joystick rightJoystick
;
15 public static Button recordData
;
16 public static Button shoot
;
17 public static Button incrementSpeed
;
18 public static Button decrementSpeed
;
20 // // first column of arcade buttons - getting past defenses
21 // public static DigitalButton passPortcullis;
22 // public static DigitalButton passChevalDeFrise;
23 // public static DigitalButton passDrawbridge;
24 // public static DigitalButton passSallyPort;
26 // // second column of arcade buttons - different angles for intake arm
27 // // TO DO: change position numbers to angle values (?)
28 // public static DigitalButton lowerChevalDeFrise;
29 // public static DigitalButton moveToIntakeBoulder;
30 // public static DigitalButton poiseAboveChevalDeFrise;
31 // public static DigitalButton moveIntakeArmInsideRobot;
33 // // left joystick buttons
34 public static Button toggleShooter
;
36 // public static Button SpinRobot180_1; // both do the same thing, just two
37 // public static Button SpinRobot180_2; // different buttons
38 // public static Button compactRobot_1;
39 // public static Button compactRobot_2;
41 // // right joystick buttons
42 // public static Button intakeBoulder;
43 // public static Button shootBoulder;
45 // // button to change robot to the scaling mode
46 // public static DigitalButton toggleScaling;
49 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
50 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
52 // passPortcullis = new DigitalButton(
53 // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
54 // passPortcullis.whenPressed(new PassPortcullis());
56 // passChevalDeFrise = new DigitalButton(
57 // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT));
58 // passChevalDeFrise.whenPressed(new PassChevalDeFrise());
60 // passDrawbridge = new DigitalButton(
61 // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT));
62 // passDrawbridge.whenPressed(new PassDrawBridge());
64 // passSallyPort = new DigitalButton(
65 // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT));
66 // passSallyPort.whenPressed(new PassSallyPort());
68 // lowerChevalDeFrise = new DigitalButton(
69 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_ONE_PORT));
70 // lowerChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
71 // IntakeArm.potAngles[0], IntakeArm.moveIntakeArmSpeed));
73 // moveToIntakeBoulder = new DigitalButton(
74 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_TWO_PORT));
75 // moveToIntakeBoulder.whenPressed(new MoveIntakeArmToAngle(
76 // IntakeArm.potAngles[1], IntakeArm.moveIntakeArmSpeed));
78 // poiseAboveChevalDeFrise = new DigitalButton(
79 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_THREE_PORT));
80 // poiseAboveChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
81 // IntakeArm.potAngles[2], IntakeArm.moveIntakeArmSpeed));
83 // moveIntakeArmInsideRobot = new DigitalButton(
84 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_FOUR_PORT));
85 // moveIntakeArmInsideRobot.whenPressed(new MoveIntakeArmToAngle(
86 // IntakeArm.potAngles[3], IntakeArm.moveIntakeArmSpeed));
88 // toggleShooter = new JoystickButton(leftJoystick,
89 // Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
91 recordData
= new JoystickButton(leftJoystick
,
92 Constants
.OI
.SPIN1_PORT
);
93 recordData
.whenPressed(new RecordData());
95 shoot
= new JoystickButton(leftJoystick
,
96 Constants
.OI
.LEFT_JOYSTICK_TRIGGER_PORT
);
97 shoot
.whenPressed(new Test1());
99 incrementSpeed
= new JoystickButton(leftJoystick
,
100 Constants
.OI
.SPIN2_PORT
);
101 incrementSpeed
.whenPressed(new Test2());
103 decrementSpeed
= new JoystickButton(leftJoystick
,
104 Constants
.OI
.LEFT_JOYSTICK_TOP_LOW_PORT
);
105 decrementSpeed
.whenPressed(new Test3());
107 // SpinRobot180_1 = new JoystickButton(leftJoystick,
108 // Constants.OI.SPIN1_PORT);
109 // SpinRobot180_1.whenPressed(new Turn180());
111 // SpinRobot180_2 = new JoystickButton(leftJoystick,
112 // Constants.OI.SPIN2_PORT);
113 // SpinRobot180_2.whenPressed(new Turn180());
115 // compactRobot_1 = new JoystickButton(leftJoystick,
116 // Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
117 // compactRobot_2 = new JoystickButton(leftJoystick,
118 // Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT);
120 // intakeBoulder = new JoystickButton(rightJoystick,
121 // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
122 // shootBoulder = new JoystickButton(rightJoystick,
123 // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT);
125 // toggleScaling = new DigitalButton(
126 // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT));
127 // toggleScaling.whenPressed(new ToggleScaling());
129 // if (!Constants.Scaler.SCALING) {
130 // toggleShooter.toggleWhenPressed(new runShooter());
131 // compactRobot_1.whenPressed(new CompactRobot());
132 // compactRobot_2.whenPressed(new CompactRobot());
134 // intakeBoulder.whenPressed(new IntakeBall());
135 // shootBoulder.whenPressed(new Shoot());
138 // // toggleShooter becomes winch
139 // // compact robot button 1 and 2 retracts the lift
140 // // intake button stops the winch
141 // // shoot button extends the lift
142 // toggleShooter.whenPressed(new RunWinchContinuous(
143 // Constants.Scaler.SCALE_SPEED, Constants.Scaler.SECONDS_TO_SCALE));
144 // compactRobot_1.whenPressed(new RetractLift());
145 // compactRobot_2.whenPressed(new RetractLift());
147 // intakeBoulder.whenReleased(new StopWinch());
148 // shootBoulder.whenPressed(new ExtendLift());