Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
86d7310b | 3 | import org.usfirst.frc.team3501.robot.commands.driving.ChangeGear; |
1e41dfe4 | 4 | import org.usfirst.frc.team3501.robot.commands.shooter.Shoot; |
0a179caa KZ |
5 | import org.usfirst.frc.team3501.robot.commands.intakearm.RunBothIntakeMotors; |
6 | import org.usfirst.frc.team3501.robot.commands.intakearm.RunIntakeMotor; | |
86d7310b | 7 | |
38a404b3 | 8 | import edu.wpi.first.wpilibj.Joystick; |
cb3389eb | 9 | import edu.wpi.first.wpilibj.buttons.Button; |
86d7310b | 10 | import edu.wpi.first.wpilibj.buttons.JoystickButton; |
38a404b3 KZ |
11 | |
12 | public class OI { | |
13 | public static Joystick leftJoystick; | |
14 | public static Joystick rightJoystick; | |
6b06b2bc | 15 | |
0a179caa KZ |
16 | public static Button leftIntakeArmMotorUp; |
17 | public static Button leftIntakeArmMotorDown; | |
18 | public static Button rightIntakeArmMotorUp; | |
19 | public static Button rightIntakeArmMotorDown; | |
20 | public static Button bothIntakeArmMotorUp; | |
21 | public static Button bothIntakeArmMotorDown; | |
6b06b2bc | 22 | |
0a179caa KZ |
23 | // // first column of arcade buttons - getting past defenses |
24 | // public static DigitalButton passPortcullis; | |
25 | // public static DigitalButton passChevalDeFrise; | |
26 | // public static DigitalButton passDrawbridge; | |
27 | // public static DigitalButton passSallyPort; | |
28 | // | |
29 | // // second column of arcade buttons - different angles for intake arm | |
30 | // // TO DO: change position numbers to angle values (?) | |
31 | // public static DigitalButton lowerChevalDeFrise; | |
32 | // public static DigitalButton moveToIntakeBoulder; | |
33 | // public static DigitalButton poiseAboveChevalDeFrise; | |
34 | // public static DigitalButton moveIntakeArmInsideRobot; | |
35 | // | |
36 | // // left joystick buttons | |
37 | // public static Button toggleShooter; | |
38 | // public static Button SpinRobot180_1; // both do the same thing, just two | |
39 | // public static Button SpinRobot180_2; // different buttons | |
40 | // public static Button compactRobot_1; | |
41 | // public static Button compactRobot_2; | |
42 | // | |
6b06b2bc CZ |
43 | // right joystick buttons |
44 | public static Button intakeBoulder; | |
45 | public static Button shootBoulder; | |
86d7310b | 46 | public static Button toggleGear; |
0a179caa KZ |
47 | // |
48 | // // button to change robot to the scaling mode | |
49 | // public static DigitalButton toggleScaling; | |
38a404b3 KZ |
50 | |
51 | public OI() { | |
52 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); | |
53 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
54 | ||
93241e25 | 55 | toggleGear = new JoystickButton(leftJoystick, |
1e41dfe4 | 56 | Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT); |
86d7310b HD |
57 | toggleGear.toggleWhenPressed(new ChangeGear()); |
58 | ||
1e41dfe4 HD |
59 | shootBoulder = new JoystickButton(leftJoystick, |
60 | Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT); | |
61 | shootBoulder.whenPressed(new Shoot()); | |
62 | ||
0a179caa KZ |
63 | recordPotAngle1 = new JoystickButton(leftJoystick, |
64 | Constants.OI.LEFT_JOYSTICK_TOP_LEFT_BUTTON); | |
65 | recordPotAngle1.whenPressed(new RecordPotAngle(0)); | |
66 | recordPotAngle2 = new JoystickButton(leftJoystick, | |
67 | Constants.OI.LEFT_JOYSTICK_TOP_CENTER_BUTTON); | |
68 | recordPotAngle2.whenPressed(new RecordPotAngle(1)); | |
69 | recordPotAngle3 = new JoystickButton(leftJoystick, | |
70 | Constants.OI.LEFT_JOYSTICK_TOP_RIGHT_BUTTON); | |
71 | recordPotAngle3.whenPressed(new RecordPotAngle(2)); | |
72 | recordPotAngle4 = new JoystickButton(leftJoystick, | |
73 | Constants.OI.LEFT_JOYSTICK_TOP_LOW_BUTTON); | |
74 | recordPotAngle4.whenPressed(new RecordPotAngle(3)); | |
75 | ||
76 | leftIntakeArmMotorUp = new JoystickButton(leftJoystick, | |
77 | Constants.OI.LEFT_JOYSTICK_BOTTOM_LEFT_FORWARD_BUTTON); | |
78 | leftIntakeArmMotorUp.whenPressed(new RunIntakeMotor( | |
79 | Robot.intakeArm.getLeftIntakeArmMotor(), | |
80 | Constants.IntakeArm.DEFAULT_INTAKE_ARM_SPEED)); | |
81 | leftIntakeArmMotorDown = new JoystickButton(leftJoystick, | |
82 | Constants.OI.LEFT_JOYSTICK_BOTTOM_LEFT_BACK_BUTTON); | |
83 | leftIntakeArmMotorDown.whenPressed(new RunIntakeMotor( | |
84 | Robot.intakeArm.getLeftIntakeArmMotor(), | |
85 | -Constants.IntakeArm.DEFAULT_INTAKE_ARM_SPEED)); | |
86 | ||
87 | rightIntakeArmMotorUp = new JoystickButton(leftJoystick, | |
88 | Constants.OI.LEFT_JOYSTICK_BOTTOM_RIGHT_FORWARD_BUTTON); | |
89 | rightIntakeArmMotorUp.whenPressed(new RunIntakeMotor( | |
90 | Robot.intakeArm.getRightIntakeArmMotor(), | |
91 | Constants.IntakeArm.DEFAULT_INTAKE_ARM_SPEED)); | |
92 | rightIntakeArmMotorDown = new JoystickButton(leftJoystick, | |
93 | Constants.OI.LEFT_JOYSTICK_BOTTOM_RIGHT_BACK_BUTTON); | |
94 | rightIntakeArmMotorDown.whenPressed(new RunIntakeMotor( | |
95 | Robot.intakeArm.getRightIntakeArmMotor(), | |
96 | -Constants.IntakeArm.DEFAULT_INTAKE_ARM_SPEED)); | |
97 | ||
98 | bothIntakeArmMotorUp = new JoystickButton(leftJoystick, | |
99 | Constants.OI.LEFT_JOYSTICK_BOTTOM_BACK_LEFT_BUTTON); | |
100 | bothIntakeArmMotorUp.whenPressed(new RunBothIntakeMotors( | |
101 | Constants.IntakeArm.DEFAULT_INTAKE_ARM_SPEED)); | |
102 | bothIntakeArmMotorDown = new JoystickButton(leftJoystick, | |
103 | Constants.OI.LEFT_JOYSTICK_BOTTOM_BACK_RIGHT_BUTTON); | |
104 | bothIntakeArmMotorDown.whenPressed(new RunBothIntakeMotors( | |
105 | -Constants.IntakeArm.DEFAULT_INTAKE_ARM_SPEED)); | |
106 | ||
a28e24c7 CZ |
107 | // passPortcullis = new DigitalButton( |
108 | // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT)); | |
109 | // passPortcullis.whenPressed(new PassPortcullis()); | |
110 | // | |
111 | // passChevalDeFrise = new DigitalButton( | |
112 | // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT)); | |
113 | // passChevalDeFrise.whenPressed(new PassChevalDeFrise()); | |
114 | // | |
115 | // passDrawbridge = new DigitalButton( | |
116 | // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT)); | |
117 | // passDrawbridge.whenPressed(new PassDrawBridge()); | |
118 | // | |
119 | // passSallyPort = new DigitalButton( | |
120 | // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT)); | |
121 | // passSallyPort.whenPressed(new PassSallyPort()); | |
122 | // | |
123 | // lowerChevalDeFrise = new DigitalButton( | |
124 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_ONE_PORT)); | |
125 | // lowerChevalDeFrise.whenPressed(new MoveIntakeArmToAngle( | |
126 | // IntakeArm.potAngles[0], IntakeArm.moveIntakeArmSpeed)); | |
127 | // | |
128 | // moveToIntakeBoulder = new DigitalButton( | |
129 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_TWO_PORT)); | |
130 | // moveToIntakeBoulder.whenPressed(new MoveIntakeArmToAngle( | |
131 | // IntakeArm.potAngles[1], IntakeArm.moveIntakeArmSpeed)); | |
132 | // | |
133 | // poiseAboveChevalDeFrise = new DigitalButton( | |
134 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_THREE_PORT)); | |
135 | // poiseAboveChevalDeFrise.whenPressed(new MoveIntakeArmToAngle( | |
136 | // IntakeArm.potAngles[2], IntakeArm.moveIntakeArmSpeed)); | |
137 | // | |
138 | // moveIntakeArmInsideRobot = new DigitalButton( | |
139 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_FOUR_PORT)); | |
140 | // moveIntakeArmInsideRobot.whenPressed(new MoveIntakeArmToAngle( | |
141 | // IntakeArm.potAngles[3], IntakeArm.moveIntakeArmSpeed)); | |
142 | // | |
143 | // toggleShooter = new JoystickButton(leftJoystick, | |
144 | // Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT); | |
145 | // SpinRobot180_1 = new JoystickButton(leftJoystick, | |
146 | // Constants.OI.SPIN1_PORT); | |
147 | // SpinRobot180_1.whenPressed(new Turn180()); | |
148 | // | |
149 | // SpinRobot180_2 = new JoystickButton(leftJoystick, | |
150 | // Constants.OI.SPIN2_PORT); | |
151 | // SpinRobot180_2.whenPressed(new Turn180()); | |
152 | // | |
153 | // compactRobot_1 = new JoystickButton(leftJoystick, | |
154 | // Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT); | |
155 | // compactRobot_2 = new JoystickButton(leftJoystick, | |
156 | // Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT); | |
157 | // | |
158 | // intakeBoulder = new JoystickButton(rightJoystick, | |
159 | // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT); | |
160 | // shootBoulder = new JoystickButton(rightJoystick, | |
161 | // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT); | |
162 | // | |
163 | // toggleScaling = new DigitalButton( | |
164 | // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT)); | |
165 | // toggleScaling.whenPressed(new ToggleScaling()); | |
166 | // | |
167 | // if (!Constants.Scaler.SCALING) { | |
168 | // toggleShooter.toggleWhenPressed(new runShooter()); | |
169 | // compactRobot_1.whenPressed(new CompactRobot()); | |
170 | // compactRobot_2.whenPressed(new CompactRobot()); | |
171 | // | |
172 | // intakeBoulder.whenPressed(new IntakeBall()); | |
173 | // shootBoulder.whenPressed(new Shoot()); | |
174 | // | |
175 | // } else { | |
176 | // // toggleShooter becomes winch | |
177 | // // compact robot button 1 and 2 retracts the lift | |
178 | // // intake button stops the winch | |
179 | // // shoot button extends the lift | |
180 | // toggleShooter.whenPressed(new RunWinchContinuous( | |
181 | // Constants.Scaler.SCALE_SPEED, Constants.Scaler.SECONDS_TO_SCALE)); | |
182 | // compactRobot_1.whenPressed(new RetractLift()); | |
183 | // compactRobot_2.whenPressed(new RetractLift()); | |
184 | // | |
185 | // intakeBoulder.whenReleased(new StopWinch()); | |
186 | // shootBoulder.whenPressed(new ExtendLift()); | |
187 | // } | |
38a404b3 KZ |
188 | } |
189 | } |