1111import com .qualcomm .robotcore .hardware .Gamepad ;
1212import com .qualcomm .robotcore .hardware .HardwareMap ;
1313
14- import org .firstinspires .ftc .teamcode .commands .claw .ClawClose ;
15- import org .firstinspires .ftc .teamcode .commands .claw .ClawOpen ;
1614import org .firstinspires .ftc .teamcode .commands .claw .ClawPivotAccepting ;
1715import org .firstinspires .ftc .teamcode .commands .claw .ClawPivotScore ;
16+ import org .firstinspires .ftc .teamcode .commands .claw .ClawRotateDown ;
17+ import org .firstinspires .ftc .teamcode .commands .claw .ClawRotateReady ;
18+ import org .firstinspires .ftc .teamcode .commands .claw .ClawRotateUp ;
1819import org .firstinspires .ftc .teamcode .commands .extendo .ExtendoAccepting ;
1920import org .firstinspires .ftc .teamcode .commands .extendo .ExtendoReady ;
2021import org .firstinspires .ftc .teamcode .commands .extendo .ExtendoScore ;
3031import org .firstinspires .ftc .teamcode .subsystems .Drivetrain ;
3132import org .firstinspires .ftc .teamcode .subsystems .Extendo ;
3233import org .firstinspires .ftc .teamcode .subsystems .Lift ;
34+ import org .firstinspires .ftc .teamcode .utils .commands .GamepadTrigger ;
3335import org .firstinspires .ftc .teamcode .utils .commands .OpModeCore ;
3436
3537@ Config
3638public class CommandRobot {
37- public Command ready , accepting , highBasket , highRung , lowBasket , lowRung , liftIncrement , liftDecrement , open , close , slamdown , specimen ;
39+ public Command ready , accepting , highBasket , highRung , lowBasket , lowRung , liftIncrement , liftDecrement , slamdown , specimen ;
40+ public GamepadTrigger intakeAccept , intakeReject ;
41+
3842 private TeleOpMode mode ;
3943
4044 private final MultipleTelemetry telemetry ;
@@ -98,8 +102,8 @@ public void startThreads() {
98102 public void configureCommands () {
99103 this .ready = new SequentialCommandGroup (
100104 new LiftAccepting (this .telemetry , this .lift ),
101- new ClawClose (this .telemetry , this .claw ),
102- new ClawPivotScore (this .telemetry , this .claw ),
105+ new ClawRotateReady (this .telemetry , this .claw ),
106+ new ClawPivotAccepting (this .telemetry , this .claw ),
103107 new WaitCommand (CommandRobot .CLAW_RETRACT_DELAY ),
104108 new ExtendoReady (this .telemetry , this .extendo )
105109 );
@@ -108,48 +112,53 @@ public void configureCommands() {
108112 new LiftAccepting (this .telemetry , this .lift ),
109113 new ExtendoAccepting (this .telemetry , this .extendo ),
110114 new WaitCommand (CommandRobot .CLAW_ACCEPT_DELAY ),
111- new ClawOpen (this .telemetry , this .claw ),
115+ new ClawRotateDown (this .telemetry , this .claw ),
112116 new ClawPivotAccepting (this .telemetry , this .claw )
113117 );
114118
115119 this .highBasket = new SequentialCommandGroup (
116120 new LiftHighBasket (this .telemetry , this .lift ),
117121 new ExtendoScore (this .telemetry , this .extendo ),
118- new ClawPivotScore (this .telemetry , this .claw )
122+ new ClawPivotScore (this .telemetry , this .claw ),
123+ new ClawRotateUp (this .telemetry , this .claw )
119124 );
120125
121126 this .lowBasket = new SequentialCommandGroup (
122127 new LiftLowBasket (this .telemetry , this .lift ),
123128 new ExtendoScore (this .telemetry , this .extendo ),
124- new ClawPivotScore (this .telemetry , this .claw )
129+ new ClawPivotScore (this .telemetry , this .claw ),
130+ new ClawRotateUp (this .telemetry , this .claw )
125131 );
126132
127133 this .highRung = new SequentialCommandGroup (
128134 new LiftHighRung (this .telemetry , this .lift ),
129135 new ExtendoScore (this .telemetry , this .extendo ),
130- new ClawPivotScore (this .telemetry , this .claw )
136+ new ClawPivotScore (this .telemetry , this .claw ),
137+ new ClawRotateUp (this .telemetry , this .claw )
131138 );
132139
133140 this .lowRung = new SequentialCommandGroup (
134141 new LiftLowRung (this .telemetry , this .lift ),
135142 new ExtendoScore (this .telemetry , this .extendo ),
136- new ClawPivotScore (this .telemetry , this .claw )
143+ new ClawPivotScore (this .telemetry , this .claw ),
144+ new ClawRotateUp (this .telemetry , this .claw )
145+
137146 );
138147
139148 this .specimen = new SequentialCommandGroup (
140149 new LiftLowRung (this .telemetry , this .lift ),
141150 new ExtendoReady (this .telemetry , this .extendo ),
142151 new ClawPivotScore (this .telemetry , this .claw ),
143- new ClawOpen (this .telemetry , this .claw )
152+ new ClawRotateReady (this .telemetry , this .claw )
144153 );
145154
155+ this .intakeAccept = new GamepadTrigger (GamepadKeys .Trigger .RIGHT_TRIGGER , d -> this .claw .setClawPower (-d ), this .gamepad2 );
156+ this .intakeReject = new GamepadTrigger (GamepadKeys .Trigger .LEFT_TRIGGER , this .claw ::setClawPower , this .gamepad2 );
157+
146158 this .liftIncrement = new LiftIncrement (this .telemetry , this .lift );
147159
148160 this .liftDecrement = new LiftDecrement (this .telemetry , this .lift );
149161
150- this .open = new ClawOpen (this .telemetry , this .claw );
151-
152- this .close = new ClawClose (this .telemetry , this .claw );
153162 }
154163
155164 public void configureControls () {
@@ -175,10 +184,6 @@ public void configureControls() {
175184 .whenPressed (this .highBasket );
176185 this .gamepad1 .getGamepadButton (GamepadKeys .Button .DPAD_LEFT )
177186 .whenPressed (this .lowBasket );
178- this .gamepad1 .getGamepadButton (GamepadKeys .Button .LEFT_BUMPER )
179- .whenPressed (this .open );
180- this .gamepad1 .getGamepadButton (GamepadKeys .Button .RIGHT_BUMPER )
181- .whenPressed (this .close );
182187 break ;
183188
184189 /* ------------------------------------- */
@@ -202,10 +207,6 @@ public void configureControls() {
202207 .whenPressed (this .lowRung );
203208 this .gamepad1 .getGamepadButton (GamepadKeys .Button .B )
204209 .whenPressed (this .highRung );
205- this .gamepad1 .getGamepadButton (GamepadKeys .Button .LEFT_BUMPER )
206- .whenPressed (this .open );
207- this .gamepad1 .getGamepadButton (GamepadKeys .Button .RIGHT_BUMPER )
208- .whenPressed (this .close );
209210 break ;
210211
211212 /* ------------------------------------- */
@@ -229,11 +230,6 @@ public void configureControls() {
229230 .whenPressed (this .lowRung );
230231 this .gamepad2 .getGamepadButton (GamepadKeys .Button .B )
231232 .whenPressed (this .highRung );
232- this .gamepad1 .getGamepadButton (GamepadKeys .Button .LEFT_BUMPER )
233- .whenPressed (this .open );
234- this .gamepad1 .getGamepadButton (GamepadKeys .Button .RIGHT_BUMPER )
235- .whenPressed (this .close );
236-
237233 break ;
238234 }
239235 }
0 commit comments