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
.shooter
.Shoot
;
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
;
39 // button to change robot to the scaling mode
40 public static DigitalButton toggleScaling
;
43 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
44 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
46 toggleGear
= new JoystickButton(leftJoystick
,
47 Constants
.OI
.LEFT_JOYSTICK_TOP_CENTER_PORT
);
48 toggleGear
.toggleWhenPressed(new ChangeGear());
50 shootBoulder
= new JoystickButton(leftJoystick
,
51 Constants
.OI
.LEFT_JOYSTICK_TRIGGER_PORT
);
52 shootBoulder
.whenPressed(new Shoot());
54 // passPortcullis = new DigitalButton(
55 // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
56 // passPortcullis.whenPressed(new PassPortcullis());
58 // passChevalDeFrise = new DigitalButton(
59 // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT));
60 // passChevalDeFrise.whenPressed(new PassChevalDeFrise());
62 // passDrawbridge = new DigitalButton(
63 // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT));
64 // passDrawbridge.whenPressed(new PassDrawBridge());
66 // passSallyPort = new DigitalButton(
67 // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT));
68 // passSallyPort.whenPressed(new PassSallyPort());
70 // lowerChevalDeFrise = new DigitalButton(
71 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_ONE_PORT));
72 // lowerChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
73 // IntakeArm.potAngles[0], IntakeArm.moveIntakeArmSpeed));
75 // moveToIntakeBoulder = new DigitalButton(
76 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_TWO_PORT));
77 // moveToIntakeBoulder.whenPressed(new MoveIntakeArmToAngle(
78 // IntakeArm.potAngles[1], IntakeArm.moveIntakeArmSpeed));
80 // poiseAboveChevalDeFrise = new DigitalButton(
81 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_THREE_PORT));
82 // poiseAboveChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
83 // IntakeArm.potAngles[2], IntakeArm.moveIntakeArmSpeed));
85 // moveIntakeArmInsideRobot = new DigitalButton(
86 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_FOUR_PORT));
87 // moveIntakeArmInsideRobot.whenPressed(new MoveIntakeArmToAngle(
88 // IntakeArm.potAngles[3], IntakeArm.moveIntakeArmSpeed));
90 // toggleShooter = new JoystickButton(leftJoystick,
91 // Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
92 // SpinRobot180_1 = new JoystickButton(leftJoystick,
93 // Constants.OI.SPIN1_PORT);
94 // SpinRobot180_1.whenPressed(new Turn180());
96 // SpinRobot180_2 = new JoystickButton(leftJoystick,
97 // Constants.OI.SPIN2_PORT);
98 // SpinRobot180_2.whenPressed(new Turn180());
100 // compactRobot_1 = new JoystickButton(leftJoystick,
101 // Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
102 // compactRobot_2 = new JoystickButton(leftJoystick,
103 // Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT);
105 // intakeBoulder = new JoystickButton(rightJoystick,
106 // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
107 // shootBoulder = new JoystickButton(rightJoystick,
108 // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT);
110 // toggleScaling = new DigitalButton(
111 // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT));
112 // toggleScaling.whenPressed(new ToggleScaling());
114 // if (!Constants.Scaler.SCALING) {
115 // toggleShooter.toggleWhenPressed(new runShooter());
116 // compactRobot_1.whenPressed(new CompactRobot());
117 // compactRobot_2.whenPressed(new CompactRobot());
119 // intakeBoulder.whenPressed(new IntakeBall());
120 // shootBoulder.whenPressed(new Shoot());
123 // // toggleShooter becomes winch
124 // // compact robot button 1 and 2 retracts the lift
125 // // intake button stops the winch
126 // // shoot button extends the lift
127 // toggleShooter.whenPressed(new RunWinchContinuous(
128 // Constants.Scaler.SCALE_SPEED, Constants.Scaler.SECONDS_TO_SCALE));
129 // compactRobot_1.whenPressed(new RetractLift());
130 // compactRobot_2.whenPressed(new RetractLift());
132 // intakeBoulder.whenReleased(new StopWinch());
133 // shootBoulder.whenPressed(new ExtendLift());