Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
150f450f CZ |
3 | import org.usfirst.frc.team3501.robot.commands.climber.BrakeCANTalons; |
4 | import org.usfirst.frc.team3501.robot.commands.climber.CoastCANTalons; | |
f74d236d CZ |
5 | import org.usfirst.frc.team3501.robot.commands.climber.RunWinch; |
6 | import org.usfirst.frc.team3501.robot.commands.climber.StopWinch; | |
8275a069 RR |
7 | import org.usfirst.frc.team3501.robot.commands.driving.ShiftDriveHighGear; |
8 | import org.usfirst.frc.team3501.robot.commands.driving.ShiftDriveLowGear; | |
f74d236d CZ |
9 | import org.usfirst.frc.team3501.robot.commands.driving.ShiftGearManipulatorPistonHigh; |
10 | import org.usfirst.frc.team3501.robot.commands.driving.ShiftGearManipulatorPistonLow; | |
cef1f36d RR |
11 | import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous; |
12 | import org.usfirst.frc.team3501.robot.commands.intake.RunIntakeContinuous; | |
5e93f308 CZ |
13 | import org.usfirst.frc.team3501.robot.commands.shooter.DecreaseShootingSpeed; |
14 | import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed; | |
9ca89e45 | 15 | import org.usfirst.frc.team3501.robot.commands.shooter.ResetShootingSpeed; |
fc01fb0f | 16 | import org.usfirst.frc.team3501.robot.commands.shooter.ReverseFlyWheelContinuous; |
cef1f36d RR |
17 | import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous; |
18 | import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous; | |
19 | import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous; | |
f74d236d | 20 | import org.usfirst.frc.team3501.robot.commands.shooter.StopFlyWheel; |
7935bf26 | 21 | |
38a404b3 | 22 | import edu.wpi.first.wpilibj.Joystick; |
de8c65d3 SG |
23 | import edu.wpi.first.wpilibj.buttons.Button; |
24 | import edu.wpi.first.wpilibj.buttons.JoystickButton; | |
38a404b3 KZ |
25 | |
26 | public class OI { | |
cca02549 | 27 | private static OI oi; |
8275a069 RR |
28 | public static Joystick xboxController; |
29 | // public static Joystick rightJoystick; | |
fc01fb0f | 30 | public static Joystick gamePad; |
38a404b3 | 31 | |
cef1f36d RR |
32 | public static Button runIndexWheel; |
33 | public static Button reverseIndexWheel; | |
f74d236d CZ |
34 | public static Button runFlyWheel; |
35 | public static Button stopFlyWheel; | |
fc01fb0f | 36 | public static Button reverseFlyWheel; |
2291f7b3 | 37 | |
8275a069 RR |
38 | // public static Button toggleGear; |
39 | public static Button shiftHigh; | |
40 | public static Button shiftLow; | |
41 | ||
f74d236d | 42 | // public static Button toggleGearManipulatorPiston; |
7935bf26 | 43 | |
cef1f36d RR |
44 | public static Button runIntake; |
45 | public static Button reverseIntake; | |
46 | ||
5e93f308 CZ |
47 | public static Button increaseShooterSpeed; |
48 | public static Button decreaseShooterSpeed; | |
9ca89e45 | 49 | public static Button resetShooterSpeed; |
5e93f308 | 50 | |
f56e6ebf CZ |
51 | public static Button brakeCANTalons; |
52 | public static Button coastCANTalons; | |
ba9f0b12 | 53 | public static Button climb; |
f74d236d CZ |
54 | public static Button stopclimb; |
55 | ||
56 | public static Button shiftGearManipulatorPistonHigh; | |
57 | public static Button shiftGearManipulatorPistonLow; | |
f56e6ebf | 58 | |
38a404b3 | 59 | public OI() { |
8275a069 RR |
60 | xboxController = new Joystick(Constants.OI.XBOX_CONTROLLER_PORT); |
61 | // rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); | |
fc01fb0f | 62 | gamePad = new Joystick(Constants.OI.GAME_PAD_PORT); |
cef1f36d | 63 | |
8275a069 | 64 | runIndexWheel = new JoystickButton(xboxController, |
5e93f308 | 65 | Constants.OI.RUN_INDEXWHEEL_PORT); |
cef1f36d RR |
66 | runIndexWheel.whileHeld(new RunIndexWheelContinuous()); |
67 | ||
8275a069 | 68 | reverseIndexWheel = new JoystickButton(xboxController, |
cef1f36d RR |
69 | Constants.OI.REVERSE_INDEXWHEEL_PORT); |
70 | reverseIndexWheel.whileHeld(new ReverseIndexWheelContinuous()); | |
71 | ||
f74d236d CZ |
72 | runFlyWheel = new JoystickButton(gamePad, Constants.OI.RUN_FLYWHEEL_PORT); |
73 | runFlyWheel.whenPressed(new RunFlyWheelContinuous()); | |
74 | ||
75 | stopFlyWheel = new JoystickButton(gamePad, Constants.OI.STOP_FLYWHEEL_PORT); | |
76 | stopFlyWheel.whenPressed(new StopFlyWheel()); | |
cef1f36d | 77 | |
fc01fb0f CZ |
78 | reverseFlyWheel = new JoystickButton(gamePad, |
79 | Constants.OI.REVERSE_FLYWHEEL_PORT); | |
80 | reverseFlyWheel.whileHeld(new ReverseFlyWheelContinuous()); | |
81 | ||
8275a069 RR |
82 | shiftHigh = new JoystickButton(xboxController, |
83 | Constants.OI.SHIFT_HIGH_PORT); | |
84 | shiftHigh.whenPressed(new ShiftDriveHighGear()); | |
85 | ||
86 | shiftLow = new JoystickButton(xboxController, Constants.OI.SHIFT_LOW_PORT); | |
87 | shiftLow.whenPressed(new ShiftDriveLowGear()); | |
fc01fb0f | 88 | |
f74d236d CZ |
89 | /* |
90 | * toggleGearManipulatorPiston = new JoystickButton(gamePad, | |
91 | * Constants.OI.TOGGLE_GEAR_MANIPULATOR_PORT); | |
92 | * toggleGearManipulatorPiston.whenPressed(new | |
93 | * ToggleGearManipulatorPiston()); | |
94 | */ | |
95 | ||
96 | shiftGearManipulatorPistonHigh = new JoystickButton(gamePad, | |
97 | Constants.OI.SHIFT_GEAR_MANIPULATOR_HIGH_PORT); | |
98 | shiftGearManipulatorPistonHigh | |
99 | .whenPressed(new ShiftGearManipulatorPistonHigh()); | |
100 | ||
101 | shiftGearManipulatorPistonLow = new JoystickButton(gamePad, | |
102 | Constants.OI.SHIFT_GEAR_MANIPULATOR_LOW_PORT); | |
103 | shiftGearManipulatorPistonLow | |
104 | .whenPressed(new ShiftGearManipulatorPistonLow()); | |
cef1f36d | 105 | |
8275a069 RR |
106 | runIntake = new JoystickButton(xboxController, |
107 | Constants.OI.RUN_INTAKE_PORT); | |
cef1f36d RR |
108 | runIntake.whileHeld(new RunIntakeContinuous()); |
109 | ||
8275a069 | 110 | reverseIntake = new JoystickButton(xboxController, |
cef1f36d RR |
111 | Constants.OI.REVERSE_INTAKE_PORT); |
112 | reverseIntake.whileHeld(new ReverseIntakeContinuous()); | |
113 | ||
fc01fb0f | 114 | increaseShooterSpeed = new JoystickButton(gamePad, |
5e93f308 CZ |
115 | Constants.OI.INCREASE_SHOOTER_SPEED_PORT); |
116 | increaseShooterSpeed.whenPressed(new IncreaseShootingSpeed()); | |
117 | ||
fc01fb0f | 118 | decreaseShooterSpeed = new JoystickButton(gamePad, |
5e93f308 CZ |
119 | Constants.OI.DECREASE_SHOOTER_SPEED_PORT); |
120 | decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed()); | |
f56e6ebf | 121 | |
9ca89e45 CZ |
122 | resetShooterSpeed = new JoystickButton(gamePad, |
123 | Constants.OI.RESET_SHOOTER_SPEED_PORT); | |
124 | resetShooterSpeed.whenPressed(new ResetShootingSpeed()); | |
125 | ||
8275a069 | 126 | brakeCANTalons = new JoystickButton(xboxController, |
f56e6ebf CZ |
127 | Constants.OI.BRAKE_CANTALONS_PORT); |
128 | brakeCANTalons.whenPressed(new BrakeCANTalons()); | |
129 | ||
8275a069 | 130 | coastCANTalons = new JoystickButton(xboxController, |
f56e6ebf CZ |
131 | Constants.OI.COAST_CANTALONS_PORT); |
132 | coastCANTalons.whenPressed(new CoastCANTalons()); | |
ba9f0b12 | 133 | |
8275a069 | 134 | climb = new JoystickButton(xboxController, Constants.OI.CLIMB_PORT); |
f74d236d CZ |
135 | climb.whenPressed(new RunWinch()); |
136 | ||
137 | stopclimb = new JoystickButton(xboxController, | |
138 | Constants.OI.STOP_CLIMB_PORT); | |
139 | stopclimb.whenPressed(new StopWinch()); | |
38a404b3 | 140 | } |
cf086549 SG |
141 | |
142 | public static OI getOI() { | |
143 | if (oi == null) | |
144 | oi = new OI(); | |
145 | return oi; | |
cca02549 | 146 | } |
38a404b3 | 147 | } |