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