1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ChangeGear
;
5 import edu
.wpi
.first
.wpilibj
.Joystick
;
6 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
7 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
10 public static Joystick leftJoystick
;
11 public static Joystick rightJoystick
;
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
;
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
;
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
;
33 // right joystick buttons
34 public static Button intakeBoulder
;
35 public static Button shootBoulder
;
36 public static Button toggleGear
;
38 // button to change robot to the scaling mode
39 public static DigitalButton toggleScaling
;
42 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
43 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
45 toggleGear
= new JoystickButton(leftJoystick
,
46 Constants
.OI
.LEFT_JOYSTICK_TRIGGER_PORT
);
47 toggleGear
.toggleWhenPressed(new ChangeGear());
49 // passPortcullis = new DigitalButton(
50 // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
51 // passPortcullis.whenPressed(new PassPortcullis());
53 // passChevalDeFrise = new DigitalButton(
54 // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT));
55 // passChevalDeFrise.whenPressed(new PassChevalDeFrise());
57 // passDrawbridge = new DigitalButton(
58 // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT));
59 // passDrawbridge.whenPressed(new PassDrawBridge());
61 // passSallyPort = new DigitalButton(
62 // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT));
63 // passSallyPort.whenPressed(new PassSallyPort());
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));
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));
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));
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));
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());
91 // SpinRobot180_2 = new JoystickButton(leftJoystick,
92 // Constants.OI.SPIN2_PORT);
93 // SpinRobot180_2.whenPressed(new Turn180());
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);
100 // intakeBoulder = new JoystickButton(rightJoystick,
101 // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
102 // shootBoulder = new JoystickButton(rightJoystick,
103 // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT);
105 // toggleScaling = new DigitalButton(
106 // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT));
107 // toggleScaling.whenPressed(new ToggleScaling());
109 // if (!Constants.Scaler.SCALING) {
110 // toggleShooter.toggleWhenPressed(new runShooter());
111 // compactRobot_1.whenPressed(new CompactRobot());
112 // compactRobot_2.whenPressed(new CompactRobot());
114 // intakeBoulder.whenPressed(new IntakeBall());
115 // shootBoulder.whenPressed(new Shoot());
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());
127 // intakeBoulder.whenReleased(new StopWinch());
128 // shootBoulder.whenPressed(new ExtendLift());