Skip to content

Commit 716aea1

Browse files
committed
Merge remote-tracking branch 'origin/event/2024cc' into event/2024cc
2 parents d7f514b + 6a76eb1 commit 716aea1

File tree

2 files changed

+59
-46
lines changed

2 files changed

+59
-46
lines changed

2024orgg.pdf

126 KB
Binary file not shown.

src/main/java/org/team1540/robot2024/RobotContainer.java

+59-46
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,16 @@ public RobotContainer() {
124124

125125
private void configureButtonBindings() {
126126
Command manualPivotCommand = new ManualPivotCommand(shooter, copilot);
127+
// coop:button(LJoystick,DT Translate,pilot)
128+
// coop:button(RJoystick,DT Rotate,pilot)
127129
drivetrain.setDefaultCommand(new SwerveDriveCommand(drivetrain, driver));
130+
// coop:button(RJoystick,Elevator Manual,copilot)
128131
elevator.setDefaultCommand(new ElevatorManualCommand(elevator, copilot));
129132
shooter.setDefaultCommand(manualPivotCommand);
133+
134+
// coop:button(B,X-Lock,pilot)
130135
driver.b().onTrue(Commands.runOnce(drivetrain::stopWithX, drivetrain));
136+
// coop:button(Y,Reorient,pilot)
131137
driver.y().onTrue(Commands.runOnce(() -> {
132138
drivetrain.zeroFieldOrientationManual();
133139
enableBrakeMode(false);
@@ -154,11 +160,14 @@ private void configureButtonBindings() {
154160
ampLock.cancel();
155161
counterShuffleDrive.cancel();
156162
});
163+
//coop:button(X,Shoot,pilot)
157164
driver.x()
158165
.whileTrue(IntakeAndFeed.withDefaults(indexer))
159166
.onFalse(cancelAlignment);
160167

168+
// coop:button(RBumper,[TOGGLE] Align Shoot,pilot)
161169
driver.rightBumper().toggleOnTrue(targetDrive);
170+
// coop:button(LBumper,[TOGGLE] Align Shuffle,pilot)
162171
driver.leftBumper().toggleOnTrue(overstageTargetDrive);
163172

164173
// TODO remove this
@@ -186,81 +195,84 @@ private void configureButtonBindings() {
186195

187196
// driver.povDown().and(() -> !DriverStation.isFMSAttached()).onTrue(Commands.runOnce(() -> drivetrain.setPose(new Pose2d(Units.inchesToMeters(260), Units.inchesToMeters(161.62), Rotation2d.fromRadians(0)))).ignoringDisable(true));
188197

198+
// coop:button(RTrigger,Countershuffle,pilot)
189199
driver.leftTrigger(0.95).toggleOnTrue(counterShuffleDrive);
190200

191201
driver.rightStick().onTrue(cancelAlignment);
192202

193203

194-
driver.povLeft().whileTrue(
195-
new DriveWithTargetingCommand(drivetrain, driver.getHID(),
196-
()->drivetrain.getPose().plus(
197-
new Transform2d(
198-
new Translation2d( 1,
199-
((DriverStation.getAlliance().orElse(null) == DriverStation.Alliance.Blue)
200-
? AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_AMP)
201-
: AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_SOURCE).rotateBy(new Rotation3d(0, 0, Math.PI)))
202-
.getRotation().toRotation2d()
203-
), new Rotation2d()
204-
)
205-
)
206-
)
207-
);
208-
driver.povRight().whileTrue(
209-
new DriveWithTargetingCommand(drivetrain, driver.getHID(),
210-
()->drivetrain.getPose().plus(
211-
new Transform2d(
212-
new Translation2d( 1,
213-
((DriverStation.getAlliance().orElse(null) == DriverStation.Alliance.Blue)
214-
? AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_SOURCE)
215-
: AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_AMP).rotateBy(new Rotation3d(0, 0, Math.PI)))
216-
.getRotation().toRotation2d()
217-
), new Rotation2d()
218-
)
219-
)
220-
)
221-
);
222-
driver.povUp().whileTrue(
223-
new DriveWithTargetingCommand(drivetrain, driver.getHID(),
224-
()->drivetrain.getPose().plus(
225-
new Transform2d(
226-
new Translation2d(1,
227-
FlipUtil.flipIfRed(AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_FAR).getRotation().toRotation2d())
228-
), new Rotation2d()
229-
)
230-
)
231-
)
232-
);
233-
204+
// driver.povLeft().whileTrue(
205+
// new DriveWithTargetingCommand(drivetrain, driver.getHID(),
206+
// ()->drivetrain.getPose().plus(
207+
// new Transform2d(
208+
// new Translation2d( 1,
209+
// ((DriverStation.getAlliance().orElse(null) == DriverStation.Alliance.Blue)
210+
// ? AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_AMP)
211+
// : AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_SOURCE).rotateBy(new Rotation3d(0, 0, Math.PI)))
212+
// .getRotation().toRotation2d()
213+
// ), new Rotation2d()
214+
// )
215+
// )
216+
// )
217+
// );
218+
// driver.povRight().whileTrue(
219+
// new DriveWithTargetingCommand(drivetrain, driver.getHID(),
220+
// ()->drivetrain.getPose().plus(
221+
// new Transform2d(
222+
// new Translation2d( 1,
223+
// ((DriverStation.getAlliance().orElse(null) == DriverStation.Alliance.Blue)
224+
// ? AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_SOURCE)
225+
// : AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_AMP).rotateBy(new Rotation3d(0, 0, Math.PI)))
226+
// .getRotation().toRotation2d()
227+
// ), new Rotation2d()
228+
// )
229+
// )
230+
// )
231+
// );
232+
// driver.povUp().whileTrue(
233+
// new DriveWithTargetingCommand(drivetrain, driver.getHID(),
234+
// ()->drivetrain.getPose().plus(
235+
// new Transform2d(
236+
// new Translation2d(1,
237+
// FlipUtil.flipIfRed(AprilTagsCrescendo.getInstance().getTag(AprilTagsCrescendo.Tags.CLIMB_FAR).getRotation().toRotation2d())
238+
// ), new Rotation2d()
239+
// )
240+
// )
241+
// )
242+
// );
243+
244+
// coop:button(Back,Zero Shooter,copilot)
234245
copilot.back().onTrue(Commands.runOnce(shooter::zeroPivotToCancoder));
235246

247+
// coop:button(LBumper,Score Amp,copilot)
236248
copilot.leftBumper().whileTrue(new AmpScoreSequence(tramp, indexer, elevator));
237249
Command intakeCommand = new ContinuousIntakeCommand(indexer, 1)
238250
.deadlineWith(CommandUtils.rumbleCommand(driver, 0.5), CommandUtils.rumbleCommand(copilot, 0.5));
251+
// coop:button(RBumper,Intake,copilot)
239252
copilot.rightBumper().whileTrue(intakeCommand);
240253

241254
copilot.povDown().whileTrue(indexer.commandRunIntake(-1));
242255
copilot.povUp().whileTrue(indexer.commandRunIntake(1));
243256
copilot.povRight().whileTrue(IntakeAndFeed.withDefaults(indexer)).onFalse(cancelAlignment);
244257
copilot.povLeft().onTrue(Commands.runOnce(()->elevator.setFlipper(true))).onFalse(Commands.runOnce(()->elevator.setFlipper(false)));
245-
// copilot.povDown().whileTrue(new ElevatorSetpointCommand(elevator, Constants.Elevator.ElevatorState.BOTTOM));
246-
// copilot.povUp().whileTrue(new ElevatorSetpointCommand(elevator, Constants.Elevator.ElevatorState.TOP));
247-
// copilot.povRight().whileTrue(new ElevatorSetpointCommand(elevator, Constants.Elevator.ElevatorState.CLIMB));
248-
// copilot.povLeft().whileTrue(new ElevatorSetpointCommand(elevator, Constants.Elevator.ElevatorState.AMP));
249-
250258

259+
// coop:button(RTrigger,Run Tramp,copilot)
251260
copilot.rightTrigger(0.95).whileTrue(tramp.commandRun(1));
252-
copilot.leftTrigger(0.95).whileTrue(new ClimbAlignment(drivetrain, elevator, tramp, indexer));
261+
// copilot.leftTrigger(0.95).whileTrue(new ClimbAlignment(drivetrain, elevator, tramp, indexer));
253262

254263

255264
copilot.x().whileTrue(new ShootSequence(shooter, indexer));
265+
// coop:button(A,[HOLD] PreAmp,copilot)
256266
copilot.a().whileTrue(new AmpScoreStageSequence(indexer, tramp, elevator).alongWith(ampLock));
267+
// coop:button(B,[HOLD] SHOOT,copilot)
257268
copilot.b()
258269
.and(shooter::areFlywheelsSpunUp)
259270
.and(() -> targetDrive.isScheduled()
260271
|| overstageTargetDrive.isScheduled()
261272
|| counterShuffleDrive.isScheduled())
262273
.whileTrue(IntakeAndFeed.withDefaults(indexer))
263274
.onFalse(cancelAlignment);
275+
// coop:button(Y,[HOLD] Stage Tramp,copilot)
264276
copilot.y().whileTrue(new StageTrampCommand(tramp, indexer));
265277

266278
// copilot.leftTrigger(0.5).whileTrue(new ElevatorSetpointCommand(elevator, ElevatorState.CLIMB));
@@ -297,6 +309,7 @@ private void configureButtonBindings() {
297309
new Trigger(tramp::isNoteStaged).debounce(0.1)
298310
.onTrue(brakeModeCommand);
299311

312+
300313
driver.start().onTrue(brakeModeCommand);
301314
copilot.start().onTrue(brakeModeCommand);
302315

0 commit comments

Comments
 (0)