From 4bcd6d931b60b3c8776718ef4ada98980591a260 Mon Sep 17 00:00:00 2001 From: Saqib Rokadia Date: Fri, 10 Apr 2026 12:04:19 -0700 Subject: [PATCH 1/2] Adding a delay to collector intake after deploy. --- .../competition/auto_programs/AutoCommandFactory.java | 11 ++++++----- .../auto_programs/CollectAndShootTwiceCommand.java | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/competition/auto_programs/AutoCommandFactory.java b/src/main/java/competition/auto_programs/AutoCommandFactory.java index 529546ef..85757216 100644 --- a/src/main/java/competition/auto_programs/AutoCommandFactory.java +++ b/src/main/java/competition/auto_programs/AutoCommandFactory.java @@ -130,11 +130,12 @@ public Command statusMessage(String message) { /** * Drives to the neutral zone ball pit, deploys the intake, drives across to collect balls. */ - public Command collectFromNeutralZone() { + public Command collectFromNeutralZone(Command collectorWaitCommand) { var group = new SequentialCommandGroup(); group.setName("CollectFromNeutralZone"); - group.addCommands(driveToNeutralZoneProvider.get()); + group.addCommands(new ParallelDeadlineGroup( + collectorWaitCommand.andThen(driveToNeutralZoneProvider.get()))); group.addCommands(new ParallelDeadlineGroup( firstDriveForCollectionCommandProvider.get(), @@ -146,11 +147,12 @@ public Command collectFromNeutralZone() { /** * Drives to the neutral zone ball pit, deploys the intake, drives across to collect balls. */ - public Command collectFromNeutralZoneSecond() { + public Command collectFromNeutralZoneSecond(Command collectorWaitCommand) { var group = new SequentialCommandGroup(); group.setName("CollectFromNeutralZoneSecond"); - group.addCommands(driveToNeutralZoneSecondTimeProvider.get()); + group.addCommands(new ParallelDeadlineGroup( + collectorWaitCommand.andThen(driveToNeutralZoneSecondTimeProvider.get()))); group.addCommands(new ParallelDeadlineGroup( secondDriveForCollectionCommandProvider.get(), @@ -172,7 +174,6 @@ public Command driveToAllianceAndShoot(Command shootingDeadline) { prepareToShoot.setPresetLocation(TrajectoriesCalculation.PresetShootingDistance.TRENCH); group.addCommands(new ParallelDeadlineGroup( driveFromNeutralZoneToAllianceProvider.get(), - collectorStopProvider.get(), prepareToShoot)); var continuousPrepare = continuousPrepareToShootProvider.get(); diff --git a/src/main/java/competition/auto_programs/CollectAndShootTwiceCommand.java b/src/main/java/competition/auto_programs/CollectAndShootTwiceCommand.java index 3c9310a1..0adcf5c7 100644 --- a/src/main/java/competition/auto_programs/CollectAndShootTwiceCommand.java +++ b/src/main/java/competition/auto_programs/CollectAndShootTwiceCommand.java @@ -19,16 +19,17 @@ public CollectAndShootTwiceCommand( pf.setPrefix(this.getName()); var firstShotTimeout = pf.createPersistentProperty("First shot timeout seconds", 3.0); var secondShotTimeout = pf.createPersistentProperty("Second shot timeout seconds", 10.0); + var collectorWait = pf.createPersistentProperty("Collector run wait seconds", 1.0); addCommands( auto.extendIntake(), - auto.collectFromNeutralZone() + auto.collectFromNeutralZone(new WaitForDurationCommand(collectorWait::get)) .alongWith(auto.statusMessage("Driving to neutral zone and back")), auto.driveToAllianceAndShoot( auto.waitForShootingDone().raceWith(new WaitForDurationCommand(firstShotTimeout::get))) .alongWith(auto.statusMessage("Driving to alliance and shoot")), auto.stopShooting().alongWith(auto.extendIntake()), - auto.collectFromNeutralZoneSecond() + auto.collectFromNeutralZoneSecond(new WaitForDurationCommand(collectorWait::get)) .alongWith(auto.statusMessage("Driving to neutral zone and back the second time")), auto.driveToAllianceAndShoot(new WaitForDurationCommand(secondShotTimeout::get)) .alongWith(auto.statusMessage("Driving to alliance and shoot"))); From 35e70033b58628a139c7a3a8fcd0a350d5a60945 Mon Sep 17 00:00:00 2001 From: Saqib Rokadia Date: Sat, 11 Apr 2026 09:46:44 -0700 Subject: [PATCH 2/2] Fix from refactor. --- .../java/competition/auto_programs/AutoCommandFactory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/competition/auto_programs/AutoCommandFactory.java b/src/main/java/competition/auto_programs/AutoCommandFactory.java index 85757216..0f6fb758 100644 --- a/src/main/java/competition/auto_programs/AutoCommandFactory.java +++ b/src/main/java/competition/auto_programs/AutoCommandFactory.java @@ -135,7 +135,8 @@ public Command collectFromNeutralZone(Command collectorWaitCommand) { group.setName("CollectFromNeutralZone"); group.addCommands(new ParallelDeadlineGroup( - collectorWaitCommand.andThen(driveToNeutralZoneProvider.get()))); + driveToNeutralZoneProvider.get(), + collectorWaitCommand.andThen(collectorIntakeProvider.get()))); group.addCommands(new ParallelDeadlineGroup( firstDriveForCollectionCommandProvider.get(), @@ -152,7 +153,8 @@ public Command collectFromNeutralZoneSecond(Command collectorWaitCommand) { group.setName("CollectFromNeutralZoneSecond"); group.addCommands(new ParallelDeadlineGroup( - collectorWaitCommand.andThen(driveToNeutralZoneSecondTimeProvider.get()))); + driveToNeutralZoneSecondTimeProvider.get() + collectorWaitCommand.andThen(collectorIntakeProvider.get()))); group.addCommands(new ParallelDeadlineGroup( secondDriveForCollectionCommandProvider.get(),