Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
86d7310b | 3 | import org.usfirst.frc.team3501.robot.commands.driving.ChangeGear; |
ee82dd56 | 4 | import org.usfirst.frc.team3501.robot.commands.driving.ToggleCompressor; |
86d7310b | 5 | |
38a404b3 | 6 | import edu.wpi.first.wpilibj.Joystick; |
cb3389eb | 7 | import edu.wpi.first.wpilibj.buttons.Button; |
86d7310b | 8 | import edu.wpi.first.wpilibj.buttons.JoystickButton; |
38a404b3 KZ |
9 | |
10 | public class OI { | |
11 | public static Joystick leftJoystick; | |
12 | public static Joystick rightJoystick; | |
6b06b2bc CZ |
13 | |
14 | // first column of arcade buttons - getting past defenses | |
15 | public static DigitalButton passPortcullis; | |
16 | public static DigitalButton passChevalDeFrise; | |
17 | public static DigitalButton passDrawbridge; | |
18 | public static DigitalButton passSallyPort; | |
19 | ||
20 | // second column of arcade buttons - different angles for intake arm | |
21 | // TO DO: change position numbers to angle values (?) | |
22 | public static DigitalButton lowerChevalDeFrise; | |
23 | public static DigitalButton moveToIntakeBoulder; | |
24 | public static DigitalButton poiseAboveChevalDeFrise; | |
25 | public static DigitalButton moveIntakeArmInsideRobot; | |
26 | ||
27 | // left joystick buttons | |
28 | public static Button toggleShooter; | |
29 | public static Button SpinRobot180_1; // both do the same thing, just two | |
30 | public static Button SpinRobot180_2; // different buttons | |
31 | public static Button compactRobot_1; | |
32 | public static Button compactRobot_2; | |
33 | ||
34 | // right joystick buttons | |
35 | public static Button intakeBoulder; | |
36 | public static Button shootBoulder; | |
86d7310b | 37 | public static Button toggleGear; |
ee82dd56 | 38 | public static Button toggleCompressor; |
6b06b2bc CZ |
39 | |
40 | // button to change robot to the scaling mode | |
52ef246c | 41 | public static DigitalButton toggleScaling; |
38a404b3 KZ |
42 | |
43 | public OI() { | |
44 | leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); | |
45 | rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
46 | ||
86d7310b HD |
47 | toggleGear = new JoystickButton(rightJoystick, |
48 | Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT); | |
49 | toggleGear.toggleWhenPressed(new ChangeGear()); | |
50 | ||
ee82dd56 HD |
51 | toggleCompressor = new JoystickButton(rightJoystick, |
52 | Constants.OI.TOGGLE_COMPRESSOR_PORT); | |
53 | toggleCompressor.whenPressed(new ToggleCompressor()); | |
54 | ||
a28e24c7 CZ |
55 | // passPortcullis = new DigitalButton( |
56 | // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT)); | |
57 | // passPortcullis.whenPressed(new PassPortcullis()); | |
58 | // | |
59 | // passChevalDeFrise = new DigitalButton( | |
60 | // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT)); | |
61 | // passChevalDeFrise.whenPressed(new PassChevalDeFrise()); | |
62 | // | |
63 | // passDrawbridge = new DigitalButton( | |
64 | // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT)); | |
65 | // passDrawbridge.whenPressed(new PassDrawBridge()); | |
66 | // | |
67 | // passSallyPort = new DigitalButton( | |
68 | // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT)); | |
69 | // passSallyPort.whenPressed(new PassSallyPort()); | |
70 | // | |
71 | // lowerChevalDeFrise = new DigitalButton( | |
72 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_ONE_PORT)); | |
73 | // lowerChevalDeFrise.whenPressed(new MoveIntakeArmToAngle( | |
74 | // IntakeArm.potAngles[0], IntakeArm.moveIntakeArmSpeed)); | |
75 | // | |
76 | // moveToIntakeBoulder = new DigitalButton( | |
77 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_TWO_PORT)); | |
78 | // moveToIntakeBoulder.whenPressed(new MoveIntakeArmToAngle( | |
79 | // IntakeArm.potAngles[1], IntakeArm.moveIntakeArmSpeed)); | |
80 | // | |
81 | // poiseAboveChevalDeFrise = new DigitalButton( | |
82 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_THREE_PORT)); | |
83 | // poiseAboveChevalDeFrise.whenPressed(new MoveIntakeArmToAngle( | |
84 | // IntakeArm.potAngles[2], IntakeArm.moveIntakeArmSpeed)); | |
85 | // | |
86 | // moveIntakeArmInsideRobot = new DigitalButton( | |
87 | // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_FOUR_PORT)); | |
88 | // moveIntakeArmInsideRobot.whenPressed(new MoveIntakeArmToAngle( | |
89 | // IntakeArm.potAngles[3], IntakeArm.moveIntakeArmSpeed)); | |
90 | // | |
91 | // toggleShooter = new JoystickButton(leftJoystick, | |
92 | // Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT); | |
93 | // SpinRobot180_1 = new JoystickButton(leftJoystick, | |
94 | // Constants.OI.SPIN1_PORT); | |
95 | // SpinRobot180_1.whenPressed(new Turn180()); | |
96 | // | |
97 | // SpinRobot180_2 = new JoystickButton(leftJoystick, | |
98 | // Constants.OI.SPIN2_PORT); | |
99 | // SpinRobot180_2.whenPressed(new Turn180()); | |
100 | // | |
101 | // compactRobot_1 = new JoystickButton(leftJoystick, | |
102 | // Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT); | |
103 | // compactRobot_2 = new JoystickButton(leftJoystick, | |
104 | // Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT); | |
105 | // | |
106 | // intakeBoulder = new JoystickButton(rightJoystick, | |
107 | // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT); | |
108 | // shootBoulder = new JoystickButton(rightJoystick, | |
109 | // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT); | |
110 | // | |
111 | // toggleScaling = new DigitalButton( | |
112 | // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT)); | |
113 | // toggleScaling.whenPressed(new ToggleScaling()); | |
114 | // | |
115 | // if (!Constants.Scaler.SCALING) { | |
116 | // toggleShooter.toggleWhenPressed(new runShooter()); | |
117 | // compactRobot_1.whenPressed(new CompactRobot()); | |
118 | // compactRobot_2.whenPressed(new CompactRobot()); | |
119 | // | |
120 | // intakeBoulder.whenPressed(new IntakeBall()); | |
121 | // shootBoulder.whenPressed(new Shoot()); | |
122 | // | |
123 | // } else { | |
124 | // // toggleShooter becomes winch | |
125 | // // compact robot button 1 and 2 retracts the lift | |
126 | // // intake button stops the winch | |
127 | // // shoot button extends the lift | |
128 | // toggleShooter.whenPressed(new RunWinchContinuous( | |
129 | // Constants.Scaler.SCALE_SPEED, Constants.Scaler.SECONDS_TO_SCALE)); | |
130 | // compactRobot_1.whenPressed(new RetractLift()); | |
131 | // compactRobot_2.whenPressed(new RetractLift()); | |
132 | // | |
133 | // intakeBoulder.whenReleased(new StopWinch()); | |
134 | // shootBoulder.whenPressed(new ExtendLift()); | |
135 | // } | |
38a404b3 KZ |
136 | } |
137 | } |