1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ChangeGear
;
4 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleCompressor
;
6 import edu
.wpi
.first
.wpilibj
.Joystick
;
7 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
8 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
11 public static Joystick leftJoystick
;
12 public static Joystick rightJoystick
;
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
;
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
;
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
;
34 // right joystick buttons
35 public static Button intakeBoulder
;
36 public static Button shootBoulder
;
37 public static Button toggleGear
;
38 public static Button toggleCompressor
;
40 // button to change robot to the scaling mode
41 public static DigitalButton toggleScaling
;
44 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
45 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
47 toggleGear
= new JoystickButton(rightJoystick
,
48 Constants
.OI
.RIGHT_JOYSTICK_TRIGGER_PORT
);
49 toggleGear
.toggleWhenPressed(new ChangeGear());
51 toggleCompressor
= new JoystickButton(rightJoystick
,
52 Constants
.OI
.TOGGLE_COMPRESSOR_PORT
);
53 toggleCompressor
.whenPressed(new ToggleCompressor());
55 // passPortcullis = new DigitalButton(
56 // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
57 // passPortcullis.whenPressed(new PassPortcullis());
59 // passChevalDeFrise = new DigitalButton(
60 // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT));
61 // passChevalDeFrise.whenPressed(new PassChevalDeFrise());
63 // passDrawbridge = new DigitalButton(
64 // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT));
65 // passDrawbridge.whenPressed(new PassDrawBridge());
67 // passSallyPort = new DigitalButton(
68 // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT));
69 // passSallyPort.whenPressed(new PassSallyPort());
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));
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));
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));
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));
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());
97 // SpinRobot180_2 = new JoystickButton(leftJoystick,
98 // Constants.OI.SPIN2_PORT);
99 // SpinRobot180_2.whenPressed(new Turn180());
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);
106 // intakeBoulder = new JoystickButton(rightJoystick,
107 // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
108 // shootBoulder = new JoystickButton(rightJoystick,
109 // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT);
111 // toggleScaling = new DigitalButton(
112 // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT));
113 // toggleScaling.whenPressed(new ToggleScaling());
115 // if (!Constants.Scaler.SCALING) {
116 // toggleShooter.toggleWhenPressed(new runShooter());
117 // compactRobot_1.whenPressed(new CompactRobot());
118 // compactRobot_2.whenPressed(new CompactRobot());
120 // intakeBoulder.whenPressed(new IntakeBall());
121 // shootBoulder.whenPressed(new Shoot());
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());
133 // intakeBoulder.whenReleased(new StopWinch());
134 // shootBoulder.whenPressed(new ExtendLift());