6
6
import edu .wpi .first .wpilibj .smartdashboard .SendableChooser ;
7
7
import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
8
8
import edu .wpi .first .wpilibj2 .command .*;
9
+ import edu .wpi .first .wpilibj2 .command .button .CommandXboxController ;
9
10
import java .util .function .Supplier ;
10
11
import org .blackknights .commands .*;
11
12
import org .blackknights .constants .ScoringConstants ;
@@ -28,8 +29,8 @@ public class RobotContainer {
28
29
ButtonBoardSubsystem buttonBoardSubsystem = new ButtonBoardSubsystem (buttonBoard );
29
30
30
31
// Controllers
31
- Controller primaryController = new Controller (0 );
32
- Controller secondaryController = new Controller (1 );
32
+ CommandXboxController primaryController = new CommandXboxController (0 );
33
+ CommandXboxController secondaryController = new CommandXboxController (1 );
33
34
34
35
private final NetworkTablesUtils NTTune = NetworkTablesUtils .getTable ("debug" );
35
36
@@ -88,20 +89,26 @@ private void configureBindings() {
88
89
true ,
89
90
true ));
90
91
91
- primaryController .leftBumper .whileTrue (
92
- getPlaceCommand (() -> coralQueue .getCurrentPosition (), () -> coralQueue .getNext ()));
93
-
94
- primaryController .rightBumper .whileTrue (
95
- new ParallelCommandGroup (
96
- new ElevatorArmCommand (
97
- elevatorSubsystem ,
98
- armSubsystem ,
99
- () -> ScoringConstants .ScoringHeights .INTAKE ),
100
- new IntakeCommand (intakeSubsystem , IntakeCommand .IntakeMode .INTAKE )));
92
+ primaryController
93
+ .leftBumper ()
94
+ .whileTrue (
95
+ getPlaceCommand (
96
+ () -> coralQueue .getCurrentPosition (), () -> coralQueue .getNext ()));
97
+
98
+ primaryController
99
+ .leftBumper ()
100
+ .whileTrue (
101
+ new ParallelCommandGroup (
102
+ new ElevatorArmCommand (
103
+ elevatorSubsystem ,
104
+ armSubsystem ,
105
+ () -> ScoringConstants .ScoringHeights .INTAKE ),
106
+ new IntakeCommand (
107
+ intakeSubsystem , IntakeCommand .IntakeMode .INTAKE )));
101
108
102
109
elevatorSubsystem .setDefaultCommand (new BaseCommand (elevatorSubsystem , armSubsystem ));
103
110
104
- primaryController .dpadDown .whileTrue (new RunCommand (() -> swerveSubsystem .zeroGyro ()));
111
+ primaryController .povDown () .whileTrue (new RunCommand (() -> swerveSubsystem .zeroGyro ()));
105
112
106
113
// SECONDARY CONTROLLER
107
114
@@ -113,32 +120,53 @@ private void configureBindings() {
113
120
// secondaryController.rightBumper.onTrue(new InstantCommand(() ->
114
121
// coralQueue.stepForwards()));
115
122
116
- secondaryController .aButton .whileTrue (
117
- new ElevatorArmCommand (
118
- elevatorSubsystem , armSubsystem , () -> ScoringConstants .ScoringHeights .L1 ));
123
+ secondaryController
124
+ .a ()
125
+ .whileTrue (
126
+ new ElevatorArmCommand (
127
+ elevatorSubsystem ,
128
+ armSubsystem ,
129
+ () -> ScoringConstants .ScoringHeights .L1 ));
119
130
120
- secondaryController .bButton .whileTrue (
121
- new ElevatorArmCommand (
122
- elevatorSubsystem , armSubsystem , () -> ScoringConstants .ScoringHeights .L2 ));
131
+ secondaryController
132
+ .b ()
133
+ .whileTrue (
134
+ new ElevatorArmCommand (
135
+ elevatorSubsystem ,
136
+ armSubsystem ,
137
+ () -> ScoringConstants .ScoringHeights .L2 ));
123
138
124
- secondaryController .xButton .whileTrue (
125
- new ElevatorArmCommand (
126
- elevatorSubsystem , armSubsystem , () -> ScoringConstants .ScoringHeights .L3 ));
139
+ secondaryController
140
+ .x ()
141
+ .whileTrue (
142
+ new ElevatorArmCommand (
143
+ elevatorSubsystem ,
144
+ armSubsystem ,
145
+ () -> ScoringConstants .ScoringHeights .L3 ));
127
146
128
- secondaryController .yButton .whileTrue (
129
- new ElevatorArmCommand (
130
- elevatorSubsystem , armSubsystem , () -> ScoringConstants .ScoringHeights .L4 ));
147
+ secondaryController
148
+ .y ()
149
+ .whileTrue (
150
+ new ElevatorArmCommand (
151
+ elevatorSubsystem ,
152
+ armSubsystem ,
153
+ () -> ScoringConstants .ScoringHeights .L4 ));
154
+
155
+ secondaryController
156
+ .leftBumper ()
157
+ .onTrue (new InstantCommand (() -> coralQueue .stepForwards ()));
131
158
132
- secondaryController .leftBumper .onTrue (new InstantCommand (() -> coralQueue .stepForwards ()));
159
+ secondaryController
160
+ .rightBumper ()
161
+ .onTrue (new InstantCommand (() -> coralQueue .stepBackwards ()));
133
162
134
- secondaryController .rightBumper .onTrue (
135
- new InstantCommand (() -> coralQueue .stepBackwards ()));
163
+ secondaryController
164
+ .rightTrigger (0.2 )
165
+ .whileTrue (new IntakeCommand (intakeSubsystem , IntakeCommand .IntakeMode .OUTTAKE ));
136
166
137
- // secondaryController.rightTrigger.whileTrue(
138
- // new IntakeCommand(intakeSubsystem, IntakeCommand.IntakeMode.OUTTAKE));
139
- //
140
- // secondaryController.leftTrigger.whileTrue(
141
- // new IntakeCommand(intakeSubsystem, IntakeCommand.IntakeMode.INTAKE));
167
+ secondaryController
168
+ .leftTrigger (0.2 )
169
+ .whileTrue (new IntakeCommand (intakeSubsystem , IntakeCommand .IntakeMode .INTAKE ));
142
170
}
143
171
144
172
/** Runs once when the code starts */
0 commit comments