From 011308017f6492ff0921820e728eaf34f80ab32d Mon Sep 17 00:00:00 2001 From: Alvin Zhang <41vin2h4n9@gmail.com> Date: Fri, 29 Mar 2024 21:28:24 -0700 Subject: [PATCH] fix: only feed to shooter if targeting is scheduled --- src/main/java/org/team1540/robot2024/RobotContainer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/team1540/robot2024/RobotContainer.java b/src/main/java/org/team1540/robot2024/RobotContainer.java index 6e0b216..4a63ffa 100644 --- a/src/main/java/org/team1540/robot2024/RobotContainer.java +++ b/src/main/java/org/team1540/robot2024/RobotContainer.java @@ -190,8 +190,13 @@ private void configureButtonBindings() { copilot.x().whileTrue(new ShootSequence(shooter, indexer)); copilot.a().whileTrue(new AmpScoreStageSequence(indexer, tramp, elevator).alongWith(ampLock)); - copilot.b().and(shooter::areFlywheelsSpunUp).whileTrue(IntakeAndFeed.withDefaults(indexer)) - .onFalse(cancelAlignment); + copilot.b() + .and(shooter::areFlywheelsSpunUp) + .and(() -> targetDrive.isScheduled() + || overstageTargetDrive.isScheduled() + || autoShooterCommand.isScheduled()) + .whileTrue(IntakeAndFeed.withDefaults(indexer)) + .onFalse(cancelAlignment); copilot.y().whileTrue(new StageTrampCommand(tramp, indexer)); // copilot.leftTrigger(0.5).whileTrue(new ElevatorSetpointCommand(elevator, ElevatorState.CLIMB));