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