Skip to content

Commit 63bb3df

Browse files
committed
dont remember lol
1 parent 9dfa53a commit 63bb3df

2 files changed

Lines changed: 140 additions & 13 deletions

File tree

src/main/java/frc/robot/BuildConstants.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ public final class BuildConstants {
55
public static final String MAVEN_GROUP = "";
66
public static final String MAVEN_NAME = "2024RobotCode";
77
public static final String VERSION = "unspecified";
8-
public static final int GIT_REVISION = 357;
9-
public static final String GIT_SHA = "3ef842811300f6ae93f92b9acc1813edc4af7f2f";
10-
public static final String GIT_DATE = "2024-10-19 17:38:18 EDT";
11-
public static final String GIT_BRANCH = "bloomfield";
12-
public static final String BUILD_DATE = "2024-10-19 18:17:32 EDT";
13-
public static final long BUILD_UNIX_TIME = 1729376252676L;
8+
public static final int GIT_REVISION = 358;
9+
public static final String GIT_SHA = "9dfa53aa84b5d502fa0383ae05141e56a77b6c3a";
10+
public static final String GIT_DATE = "2024-10-20 11:22:43 EDT";
11+
public static final String GIT_BRANCH = "tk-demo-mode";
12+
public static final String BUILD_DATE = "2024-11-27 08:13:20 EST";
13+
public static final long BUILD_UNIX_TIME = 1732713200167L;
1414
public static final int DIRTY = 1;
1515

1616
private BuildConstants() {}

src/main/java/frc/robot/RobotContainer.java

Lines changed: 134 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import frc.robot.Constants.SHOOT_STATE;
3838
import frc.robot.commands.AimbotAuto;
3939
import frc.robot.commands.AimbotStatic;
40-
import frc.robot.commands.AimbotTele;
4140
import frc.robot.commands.AlignToNoteAuto;
4241
import frc.robot.commands.AngleShooter;
4342
// import frc.robot.commands.AngleShooterShoot;
@@ -283,9 +282,10 @@ public RobotContainer() {
283282
new InstantCommand(() -> shooter.setFeedersRPM(1000))),
284283
Map.entry(
285284
SHOOT_STATE.AIMBOT,
286-
new SequentialCommandGroup(
287-
new SetElevatorTarget(0, 1.5, elevator),
288-
new AimbotTele(drive, driveController, shooter, pivot, led))),
285+
// new SequentialCommandGroup(
286+
// new SetElevatorTarget(0, 1.5, elevator),
287+
// new AimbotTele(drive, driveController, shooter, pivot, led))),
288+
new InstantCommand(() -> shooter.setFeedersRPM(1000))),
289289
Map.entry(
290290
SHOOT_STATE.AMP,
291291
new SequentialCommandGroup(
@@ -473,12 +473,137 @@ public RobotContainer() {
473473
* edu.wpi.first.wpilibj2.command.button.JoystickButton}.
474474
*/
475475
private void configureButtonBindings() {
476-
driverControls();
477-
manipControls();
478-
476+
// driverControls();
477+
// manipControls();
478+
demoControls();
479479
// testControls();
480480
}
481481

482+
private void demoControls() {
483+
drive.setDefaultCommand(
484+
DriveCommands.joystickDrive(
485+
drive,
486+
() -> -driveController.getLeftY(),
487+
() -> -driveController.getLeftX(),
488+
() -> -driveController.getRightX(),
489+
driveLeftBumper,
490+
manipLeftBumper));
491+
492+
driveRightBumper.onTrue(
493+
new SequentialCommandGroup(
494+
new InstantCommand(() -> climbStateMachine.setClimbState(CLIMB_STATES.NONE)),
495+
new InstantCommand(() -> trapStateMachine.setTargetState(TRAP_STATES.PIVOT)),
496+
new SetElevatorTarget(0, 1.5, elevator),
497+
DriveCommands.intakeCommand(
498+
drive,
499+
shooter,
500+
pivot,
501+
intake,
502+
led,
503+
driveController,
504+
() -> -driveController.getLeftY(),
505+
() -> -driveController.getLeftX(),
506+
() -> -driveController.getRightX(),
507+
() -> false,
508+
manipLeftBumper)));
509+
510+
driveRightBumper.onFalse(
511+
new InstantCommand(() -> led.setState(LED_STATE.BLUE))
512+
.andThen(new InstantCommand(() -> intake.changeLEDBoolFalse()))
513+
.andThen(new InstantCommand(() -> shooter.setFeedersRPM(500)))
514+
.andThen(new WaitCommand(0.02))
515+
.andThen(
516+
new ConditionalCommand(
517+
new WaitCommand(0.1),
518+
new WaitCommand(0.06),
519+
() -> (shooter.getLastNoteState() == NoteState.CURRENT)))
520+
.andThen(
521+
new ParallelCommandGroup(
522+
new InstantCommand(() -> intake.stopRollers(), intake),
523+
new InstantCommand(() -> shooter.stopFeeders()),
524+
new SetPivotTarget(Constants.PivotConstants.STOW_SETPOINT_DEG, pivot))
525+
.andThen(new PositionNoteInFeeder(shooter, intake))));
526+
527+
driveStartButton.onTrue(
528+
Commands.runOnce(
529+
() ->
530+
drive.setGyroPose(
531+
new Pose2d(drive.getPose().getTranslation(), new Rotation2d())),
532+
drive)
533+
.ignoringDisable(true));
534+
535+
driveLeftBumper.onTrue(
536+
new SequentialCommandGroup(
537+
new InstantCommand(() -> climbStateMachine.setClimbState(CLIMB_STATES.NONE)),
538+
new InstantCommand(() -> trapStateMachine.setTargetState(TRAP_STATES.PIVOT)),
539+
new SetElevatorTarget(0, 1.5, elevator),
540+
DriveCommands.intakeCommand(
541+
drive,
542+
shooter,
543+
pivot,
544+
intake,
545+
led,
546+
driveController,
547+
() -> -driveController.getLeftY(),
548+
() -> -driveController.getLeftX(),
549+
() -> -driveController.getRightX(),
550+
() -> true,
551+
manipLeftBumper)));
552+
driveLeftBumper.onFalse(
553+
new InstantCommand(() -> led.setState(LED_STATE.BLUE))
554+
.andThen(new InstantCommand(() -> intake.changeLEDBoolFalse()))
555+
.andThen(new InstantCommand(() -> shooter.setFeedersRPM(500)))
556+
.andThen(new WaitCommand(0.02))
557+
.andThen(
558+
new ConditionalCommand(
559+
new WaitCommand(0.1),
560+
new WaitCommand(0.06),
561+
() -> (shooter.getLastNoteState() == NoteState.CURRENT)))
562+
.andThen(
563+
new ParallelCommandGroup(
564+
new InstantCommand(() -> intake.stopRollers(), intake),
565+
new InstantCommand(() -> shooter.stopFeeders()),
566+
new SetPivotTarget(Constants.PivotConstants.STOW_SETPOINT_DEG, pivot))
567+
.andThen(new PositionNoteInFeeder(shooter, intake))));
568+
569+
driveLeftTrigger.whileTrue(new PivotIntakeTele(pivot, intake, shooter, led, true, false));
570+
driveLeftTrigger.onFalse(
571+
new InstantCommand(intake::stopRollers)
572+
.andThen(new SetPivotTarget(Constants.PivotConstants.STOW_SETPOINT_DEG, pivot))
573+
.andThen(new InstantCommand(() -> shooter.stopFeeders())));
574+
575+
driveRightTrigger.onTrue(shootCommands);
576+
driveRightTrigger.onFalse(
577+
new InstantCommand(() -> shooter.stopFeeders(), shooter)
578+
.andThen(new InstantCommand(() -> led.setState(LED_STATE.BLUE)))
579+
.andThen(new SetPivotTarget(Constants.PivotConstants.STOW_SETPOINT_DEG, pivot))
580+
.andThen(
581+
new SetElevatorTarget(
582+
Constants.ElevatorConstants.RETRACT_SETPOINT_INCH,
583+
Constants.ElevatorConstants.THRESHOLD,
584+
elevator))
585+
.andThen(new WaitCommand(0.5))
586+
.andThen(new InstantCommand(shooter::stopFlywheels))
587+
.andThen(new InstantCommand(() -> shooter.turnOffFan(), shooter)));
588+
589+
driveController
590+
.b()
591+
.onTrue(
592+
new SequentialCommandGroup(
593+
new InstantCommand(() -> climbStateMachine.setClimbState(CLIMB_STATES.NONE)),
594+
new InstantCommand(() -> trapStateMachine.setTargetState(TRAP_STATES.PIVOT)),
595+
new SetElevatorTarget(0, 1.5, elevator),
596+
new InstantCommand(() -> pivot.setShootState(SHOOT_STATE.PIVOT_PRESET)),
597+
new SetPivotTarget(45, pivot),
598+
new InstantCommand(() -> shooter.setFlywheelRPMs(2000, 2300))));
599+
driveController
600+
.b()
601+
.onFalse(
602+
new InstantCommand(() -> led.setState(LED_STATE.BLUE))
603+
.andThen(new InstantCommand(() -> shooter.stopFlywheels()))
604+
.andThen(new SetPivotTarget(Constants.PivotConstants.STOW_SETPOINT_DEG, pivot)));
605+
}
606+
482607
private void testControls() {
483608
drive.setDefaultCommand(
484609
DriveCommands.joystickDrive(
@@ -560,6 +685,8 @@ private void testControls() {
560685
new InstantCommand(() -> elevator.setConstraints(30, 85)),
561686
new InstantCommand(() -> shooter.stopFlywheels(), shooter),
562687
new SetPivotTarget(Constants.PivotConstants.STOW_SETPOINT_DEG, pivot))));
688+
689+
driveAButton.onTrue(climbCommands);
563690
}
564691

565692
private void driverControls() {

0 commit comments

Comments
 (0)