From b986fa76f296d6a5b7df6d19d0daec94bbe60fdd Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Tue, 19 May 2026 09:39:36 -0600 Subject: [PATCH 01/11] fix documentation --- .../ftc/teamcode/constants/AutonomousConstants.java | 2 +- .../firstinspires/ftc/teamcode/constants/ShooterConstants.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java index e8e8dc5..0855f6a 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java @@ -14,7 +14,7 @@ public final class AutonomousConstants { public static long SHOOT_REVERSE_CYCLE_MS = 100; public static double INTAKE_FORWARD_SPEED = 1.0; - public static double INTAKE_REVERSE_SPEED = 0.45; // As requested, default should be 0.45 + public static double INTAKE_REVERSE_SPEED = 0.45; // Feeder timings/speeds during autonomous public static double FEEDER_SPEED = 1.0; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java index 2c05bfb..6c5b11d 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java @@ -6,6 +6,8 @@ public class ShooterConstants { public static double TICKS_PER_REV = 28.0; + // it should be noted that we have switched to bang bang, + // as it updates faster than this PID. public static double PID_P = 120.0; public static double PID_I = 0.006; public static double PID_D = 0.0; From f965e6a3c5ded0d658aa4fde99be99234b1e267a Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:03:31 -0600 Subject: [PATCH 02/11] add back ftc dashboard --- build.dependencies.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.dependencies.gradle b/build.dependencies.gradle index a61e713..5c8e36f 100644 --- a/build.dependencies.gradle +++ b/build.dependencies.gradle @@ -2,6 +2,7 @@ repositories { mavenCentral() google() // Needed for androidx maven { url = "https://mymaven.bylazar.com/releases" } + maven { url = "https://maven.brott.dev/" } } dependencies { @@ -18,5 +19,6 @@ dependencies { implementation 'com.pedropathing:ftc:2.0.5' implementation 'com.pedropathing:telemetry:1.0.0' implementation 'com.bylazar:fullpanels:1.0.9' + implementation 'com.acmerobotics.dashboard:dashboard:0.4.16' } From e7dc40f795a944715999aee1f0cee23eede97dcb Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:05:24 -0600 Subject: [PATCH 03/11] fix path follower, similar opmode feeder preloading, dont allow shooting before time to spin up flywheel, full speed intake, delay between command logic --- .../ftc/teamcode/autonomous/Controller.java | 124 +++++++++++++----- 1 file changed, 92 insertions(+), 32 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/Controller.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/Controller.java index 6453f86..6ea9fa6 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/Controller.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/Controller.java @@ -2,19 +2,23 @@ import com.pedropathing.follower.Follower; import com.pedropathing.geometry.Pose; -import com.pedropathing.pathgen.BezierLine; -import com.pedropathing.pathgen.Path; -import com.pedropathing.pathgen.Point; +import com.pedropathing.geometry.BezierLine; +import com.pedropathing.paths.PathChain; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.util.ElapsedTime; +import com.qualcomm.hardware.rev.RevColorSensorV3; import org.firstinspires.ftc.teamcode.RobotContainer; import org.firstinspires.ftc.teamcode.constants.AutonomousConstants; +import org.firstinspires.ftc.teamcode.constants.HardwareConstants; +import org.firstinspires.ftc.teamcode.constants.ShooterConstants; public class Controller { private final LinearOpMode opMode; private final RobotContainer robot; private Follower follower; + private RevColorSensorV3 colorShootSensor; + private boolean isShooting = false; public Controller(LinearOpMode opMode, RobotContainer robot) { this.opMode = opMode; @@ -24,6 +28,14 @@ public Controller(LinearOpMode opMode, RobotContainer robot) { public void init() { // Assume robot.init has already been called in BaseAutoOpMode follower = robot.getFollower(); + try { + colorShootSensor = opMode.hardwareMap.get(RevColorSensorV3.class, HardwareConstants.COLOR_SHOOT_SENSOR); + } catch (Exception ignored) { + colorShootSensor = null; + } + + // Start the intake forward at configurable speed immediately + robot.intake.runFromTrigger(AutonomousConstants.INTAKE_FORWARD_SPEED); } public void setStartingPose(Pose startPose) { @@ -42,12 +54,9 @@ public void startShooter(double rpm) { * Turns on the intake to the default forward speed. */ public void enableIntake() { - robot.intake.reverse(-AutonomousConstants.INTAKE_FORWARD_SPEED); // Assuming forward is positive in reverse? Wait, IntakeSubsystem uses runFromTrigger. - // Actually, IntakeSubsystem has reverse(power) where positive power reverses it. - // Let's look at IntakeSubsystem. runFromTrigger(value) runs forward. reverse(value) runs backward. + robot.intake.runFromTrigger(AutonomousConstants.INTAKE_FORWARD_SPEED); } - // I need to correct IntakeSubsystem calls later. Let's make helper methods for this: public void runIntakeForward() { robot.intake.runFromTrigger(AutonomousConstants.INTAKE_FORWARD_SPEED); } @@ -66,17 +75,38 @@ public void disableIntake() { public void pathTo(Pose targetPose) { if (!opMode.opModeIsActive()) return; - Path path = new Path(new BezierLine( - new Point(follower.getPose()), - new Point(targetPose) - )); - path.setLinearHeadingInterpolation(follower.getPose().getHeading(), targetPose.getHeading()); + com.pedropathing.paths.PathBuilder builder = follower.pathBuilder(); + builder.addPath(new BezierLine(follower.getPose(), targetPose)) + .setLinearHeadingInterpolation(follower.getPose().getHeading(), targetPose.getHeading()); + PathChain path = builder.build(); follower.followPath(path); while (opMode.opModeIsActive() && follower.isBusy()) { update(); } + + delayBetweenCommands(); + } + + /** + * Drives to a point with a custom maximum speed scaling and blocks until the robot is near the target or opmode stops. + */ + public void pathTo(Pose targetPose, double speedPercent) { + if (!opMode.opModeIsActive()) return; + + com.pedropathing.paths.PathBuilder builder = follower.pathBuilder(); + builder.addPath(new BezierLine(follower.getPose(), targetPose)) + .setLinearHeadingInterpolation(follower.getPose().getHeading(), targetPose.getHeading()); + PathChain path = builder.build(); + + follower.followPath(path, speedPercent, true); + + while (opMode.opModeIsActive() && follower.isBusy()) { + update(); + } + + delayBetweenCommands(); } /** @@ -86,36 +116,30 @@ public void pathTo(Pose targetPose) { public void shoot(long durationMs) { if (!opMode.opModeIsActive()) return; + // Wait to allow the flywheel to spin up before feeding the balls + if (AutonomousConstants.SPIN_UP_DELAY_MS > 0) { + ElapsedTime spinUpTimer = new ElapsedTime(); + while (opMode.opModeIsActive() && spinUpTimer.milliseconds() < AutonomousConstants.SPIN_UP_DELAY_MS) { + update(); + } + } + + isShooting = true; + ElapsedTime timer = new ElapsedTime(); timer.reset(); - - ElapsedTime cycleTimer = new ElapsedTime(); - cycleTimer.reset(); robot.shooter.setFeederPower(AutonomousConstants.FEEDER_SPEED); + robot.intake.runFromTrigger(1.0); while (opMode.opModeIsActive() && timer.milliseconds() < durationMs) { - long cycleTime = (long) cycleTimer.milliseconds(); - long totalCycleMs = AutonomousConstants.SHOOT_FORWARD_CYCLE_MS + AutonomousConstants.SHOOT_REVERSE_CYCLE_MS; - - if (cycleTime > totalCycleMs) { - cycleTimer.reset(); - cycleTime = 0; - } - - if (cycleTime < AutonomousConstants.SHOOT_FORWARD_CYCLE_MS) { - runIntakeForward(); - } else { - runIntakeReverse(); - } - update(); } robot.shooter.setFeederPower(0.0); - // Turn intake back to normal forward spinning after shooting finishes, - // since the user states "intake should be running the entire time" - runIntakeForward(); + isShooting = false; + + delayBetweenCommands(); } /** @@ -123,6 +147,42 @@ public void shoot(long durationMs) { */ public void update() { follower.update(); + + // Always ensure the intake is running forward during autonomous + robot.intake.runFromTrigger(AutonomousConstants.INTAKE_FORWARD_SPEED); + + if (!isShooting) { + double feederPower; + int alpha = -1; + if (colorShootSensor != null) { + alpha = colorShootSensor.alpha(); + } + boolean shouldStopIndexer = alpha > ShooterConstants.FEEDER_ALPHA_STOP_THRESHOLD; + feederPower = shouldStopIndexer ? 0.0 : ShooterConstants.FEEDER_INDEX_POWER; + robot.shooter.setFeederPower(feederPower); + } + robot.shooter.update(); } + + /** + * Sleeps for the specified duration in milliseconds while updating background subsystems. + */ + public void sleep(long durationMs) { + if (!opMode.opModeIsActive()) return; + + ElapsedTime timer = new ElapsedTime(); + while (opMode.opModeIsActive() && timer.milliseconds() < durationMs) { + update(); + } + } + + private void delayBetweenCommands() { + if (AutonomousConstants.COMMAND_DELAY_MS > 0 && opMode.opModeIsActive()) { + ElapsedTime delayTimer = new ElapsedTime(); + while (opMode.opModeIsActive() && delayTimer.milliseconds() < AutonomousConstants.COMMAND_DELAY_MS) { + update(); + } + } + } } From 90399703348be3e0229111c02376524fd774f77e Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:05:43 -0600 Subject: [PATCH 04/11] run intake full speed, delay for pinpoint calibration routine. --- .../ftc/teamcode/autonomous/BaseAutoOpMode.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/BaseAutoOpMode.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/BaseAutoOpMode.java index eb00880..295645b 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/BaseAutoOpMode.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/BaseAutoOpMode.java @@ -3,6 +3,7 @@ import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import org.firstinspires.ftc.teamcode.RobotContainer; +import org.firstinspires.ftc.teamcode.constants.AutonomousConstants; public abstract class BaseAutoOpMode extends LinearOpMode { protected final RobotContainer robot = new RobotContainer(); @@ -18,6 +19,12 @@ public void runOpMode() throws InterruptedException { return; } + // Start the intake forward immediately at autonomous start + robot.intake.runFromTrigger(AutonomousConstants.INTAKE_FORWARD_SPEED); + + // Wait 800 ms to let the Pinpoint calibrate on reset + sleep(1200); + runAutonomous(); robot.stopAll(); } From 8cef0404a5821f497313d7b63361de4f9809f0b3 Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:06:30 -0600 Subject: [PATCH 05/11] spin up delay implementation, slow path over row intakes for crappy intake (grr) skip human intake option for 3+ ball autos --- .../autonomous/opmodes/BlueBack12.java | 26 ++++++++++++------- .../autonomous/opmodes/BlueBack6.java | 18 ++++++++----- .../autonomous/opmodes/BlueBack9.java | 22 ++++++++++------ .../autonomous/opmodes/BlueFront3.java | 4 +++ .../autonomous/opmodes/BlueFront6.java | 8 ++++-- .../autonomous/opmodes/BlueFront9.java | 12 ++++++--- .../autonomous/opmodes/RedBack12.java | 25 +++++++++++------- .../teamcode/autonomous/opmodes/RedBack6.java | 18 ++++++++----- .../teamcode/autonomous/opmodes/RedBack9.java | 21 +++++++++------ .../autonomous/opmodes/RedFront3.java | 5 +++- .../autonomous/opmodes/RedFront6.java | 7 +++-- .../autonomous/opmodes/RedFront9.java | 11 +++++--- 12 files changed, 116 insertions(+), 61 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack12.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack12.java index 147f19f..7efd5fa 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack12.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack12.java @@ -19,34 +19,40 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); // Engage intake (for rest of auton) controller.runIntakeForward(); - // 3. move to human player ball intake position - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_HUMAN); - - // 4. shoot balls - controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); - controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + if (!AutonomousConstants.SKIP_HUMAN_INTAKE) { + // 3. move to human player ball intake position + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_HUMAN); + + // 4. shoot balls + controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); + controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + } // 5. move to intake position 1 for back row intake - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_1); + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 6. move to intake position 2 for back row intake - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_2); + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 7. shoot balls controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); // 8. move to intake position 1 for middle row intake - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_MIDDLE_1); + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_MIDDLE_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 9. move to intake position 2 for middle row intake - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_MIDDLE_2); + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_MIDDLE_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 10. shoot balls controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack6.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack6.java index 4e93ff1..36b09b4 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack6.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack6.java @@ -19,18 +19,24 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); // Engage intake (for rest of auton) controller.runIntakeForward(); - // 3. move to human player ball intake position - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_HUMAN); - - // 4. shoot balls - controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); - controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + if (!AutonomousConstants.SKIP_HUMAN_INTAKE) { + // 3. move to human player ball intake position + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_HUMAN); + + // 4. shoot balls + controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); + controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + } // 5. park back position controller.pathTo(AutonomousPoints.Blue.Back.CLOSE_PARK); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack9.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack9.java index a2c6a17..a126490 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack9.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueBack9.java @@ -19,24 +19,30 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); // Engage intake (for rest of auton) controller.runIntakeForward(); - // 3. move to human player ball intake position - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_HUMAN); - - // 4. shoot balls - controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); - controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + if (!AutonomousConstants.SKIP_HUMAN_INTAKE) { + // 3. move to human player ball intake position + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_HUMAN); + + // 4. shoot balls + controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); + controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + } // 5. move to intake position 1 for back row intake - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_1); + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 6. move to intake position 2 for back row intake - controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_2); + controller.pathTo(AutonomousPoints.Blue.Back.INTAKE_CLOSE_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 7. shoot balls controller.pathTo(AutonomousPoints.Blue.Back.SHOOT); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront3.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront3.java index 2c23777..d17f42f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront3.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront3.java @@ -19,6 +19,10 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Blue.Front.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront6.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront6.java index ec3ad5a..294900f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront6.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront6.java @@ -19,6 +19,10 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Blue.Front.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); @@ -26,10 +30,10 @@ protected void runAutonomous() { controller.runIntakeForward(); // 3. move to intake position 1 for far row intake - controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_1); + controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 4. move to intake position 2 for far row intake - controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_2); + controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 5. move to shoot position controller.pathTo(AutonomousPoints.Blue.Front.SHOOT); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront9.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront9.java index 751978a..c44870b 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront9.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/BlueFront9.java @@ -19,6 +19,10 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Blue.Front.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); @@ -26,10 +30,10 @@ protected void runAutonomous() { controller.runIntakeForward(); // 3. move to intake position 1 for far row intake - controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_1); + controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 4. move to intake position 2 for far row intake - controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_2); + controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_FAR_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 5. move to shoot position controller.pathTo(AutonomousPoints.Blue.Front.SHOOT); @@ -38,10 +42,10 @@ protected void runAutonomous() { controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); // 7. move to intake position 1 for middle row intake - controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_MID_1); + controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_MID_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 8. move to intake position 2 for middle row intake - controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_MID_2); + controller.pathTo(AutonomousPoints.Blue.Front.INTAKE_MID_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 9. move to shoot position controller.pathTo(AutonomousPoints.Blue.Front.SHOOT); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack12.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack12.java index 5df74ad..5ffdf43 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack12.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack12.java @@ -19,34 +19,39 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Red.Back.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); // Engage intake (for rest of auton) controller.runIntakeForward(); - // 3. move to human player ball intake position - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_HUMAN); - - // 4. shoot balls - controller.pathTo(AutonomousPoints.Red.Back.SHOOT); - controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + if (!AutonomousConstants.SKIP_HUMAN_INTAKE) { + // 3. move to human player ball intake position + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_HUMAN); + + // 4. shoot balls + controller.pathTo(AutonomousPoints.Red.Back.SHOOT); + controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + } // 5. move to intake position 1 for back row intake - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_1); + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 6. move to intake position 2 for back row intake - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_2); + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 7. shoot balls controller.pathTo(AutonomousPoints.Red.Back.SHOOT); controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); // 8. move to intake position 1 for middle row intake - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_MIDDLE_1); + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_MIDDLE_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 9. move to intake position 2 for middle row intake - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_MIDDLE_2); + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_MIDDLE_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 10. shoot balls controller.pathTo(AutonomousPoints.Red.Back.SHOOT); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack6.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack6.java index bd74a92..ac59826 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack6.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack6.java @@ -19,18 +19,24 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Red.Back.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); // Engage intake (for rest of auton) controller.runIntakeForward(); - // 3. move to human player ball intake position - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_HUMAN); - - // 4. shoot balls - controller.pathTo(AutonomousPoints.Red.Back.SHOOT); - controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + if (!AutonomousConstants.SKIP_HUMAN_INTAKE) { + // 3. move to human player ball intake position + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_HUMAN); + + // 4. shoot balls + controller.pathTo(AutonomousPoints.Red.Back.SHOOT); + controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + } // 5. park back position controller.pathTo(AutonomousPoints.Red.Back.CLOSE_PARK); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack9.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack9.java index 4c6ee61..4ed5092 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack9.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedBack9.java @@ -19,24 +19,29 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Red.Back.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); // Engage intake (for rest of auton) controller.runIntakeForward(); - // 3. move to human player ball intake position - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_HUMAN); - - // 4. shoot balls - controller.pathTo(AutonomousPoints.Red.Back.SHOOT); - controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + if (!AutonomousConstants.SKIP_HUMAN_INTAKE) { + // 3. move to human player ball intake position + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_HUMAN); + + // 4. shoot balls + controller.pathTo(AutonomousPoints.Red.Back.SHOOT); + controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); + } // 5. move to intake position 1 for back row intake - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_1); + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 6. move to intake position 2 for back row intake - controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_2); + controller.pathTo(AutonomousPoints.Red.Back.INTAKE_CLOSE_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 7. shoot balls controller.pathTo(AutonomousPoints.Red.Back.SHOOT); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront3.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront3.java index ff198b0..11720d4 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront3.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront3.java @@ -15,10 +15,13 @@ protected void runAutonomous() { controller.setStartingPose(AutonomousPoints.Red.Front.SHOOT); controller.startShooter(AutonomousConstants.FAR_SHOOT_RPM); - + // 1. move to shoot position controller.pathTo(AutonomousPoints.Red.Front.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront6.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront6.java index ce3175a..9d27373 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront6.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront6.java @@ -19,6 +19,9 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Red.Front.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); @@ -26,10 +29,10 @@ protected void runAutonomous() { controller.runIntakeForward(); // 3. move to intake position 1 for far row intake - controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_1); + controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 4. move to intake position 2 for far row intake - controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_2); + controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 5. move to shoot position controller.pathTo(AutonomousPoints.Red.Front.SHOOT); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront9.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront9.java index 991c579..adb1352 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront9.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/opmodes/RedFront9.java @@ -19,6 +19,9 @@ protected void runAutonomous() { // 1. move to shoot position controller.pathTo(AutonomousPoints.Red.Front.SHOOT); + // 1.5 wait for spin up delay + controller.sleep(AutonomousConstants.SPIN_UP_DELAY_MS); + // 2. shoot balls (preloads) controller.shoot(AutonomousConstants.PRELOAD_SHOOT_TIME); @@ -26,10 +29,10 @@ protected void runAutonomous() { controller.runIntakeForward(); // 3. move to intake position 1 for far row intake - controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_1); + controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 4. move to intake position 2 for far row intake - controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_2); + controller.pathTo(AutonomousPoints.Red.Front.INTAKE_FAR_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 5. move to shoot position controller.pathTo(AutonomousPoints.Red.Front.SHOOT); @@ -38,10 +41,10 @@ protected void runAutonomous() { controller.shoot(AutonomousConstants.CYCLE_SHOOT_TIME); // 7. move to intake position 1 for middle row intake - controller.pathTo(AutonomousPoints.Red.Front.INTAKE_MID_1); + controller.pathTo(AutonomousPoints.Red.Front.INTAKE_MID_1, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 8. move to intake position 2 for middle row intake - controller.pathTo(AutonomousPoints.Red.Front.INTAKE_MID_2); + controller.pathTo(AutonomousPoints.Red.Front.INTAKE_MID_2, AutonomousConstants.INTAKE_PATH_SPEED_SCALING); // 9. move to shoot position controller.pathTo(AutonomousPoints.Red.Front.SHOOT); From ee66978c09e5cef0396b56a52958896b83f5b8ea Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:06:39 -0600 Subject: [PATCH 06/11] intake speed for autocycles in teleop --- .../org/firstinspires/ftc/teamcode/constants/AutoConstants.java | 1 + 1 file changed, 1 insertion(+) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutoConstants.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutoConstants.java index 48b862c..39e44b5 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutoConstants.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutoConstants.java @@ -7,6 +7,7 @@ public class AutoConstants { public static double CYCLE_FEED_LEAD_SECONDS = 0.025; public static double CYCLE_POSITION_TOLERANCE_INCHES = 1.25; public static double CYCLE_HEADING_TOLERANCE_DEGREES = 4.0; + public static double CYCLE_INTAKE_POWER = 1.0; // All cycle points are relative to the reset origin (0,0,0) set with start. public static double BLUE_CYCLE_A_X_INCHES = 61.75; From deddf6662facc290555d5fe907b698609da35a8a Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:06:57 -0600 Subject: [PATCH 07/11] individual shoot rpms for distances, intake speed, skip homan intake setting --- .../constants/AutonomousConstants.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java index 0855f6a..5a09ed8 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousConstants.java @@ -1,29 +1,44 @@ package org.firstinspires.ftc.teamcode.constants; import com.acmerobotics.dashboard.config.Config; +import com.bylazar.configurables.annotations.Configurable; + @Config +@Configurable public final class AutonomousConstants { // Shooter RPM settings - public static double FAR_SHOOT_RPM = 3000.0; - public static double CLOSE_SHOOT_RPM = 2500.0; + public static double FAR_SHOOT_RPM = 6000.0; + public static double CLOSE_SHOOT_RPM = 6000.0; // Intake timings/speeds - public static long SHOOT_FORWARD_CYCLE_MS = 900; - public static long SHOOT_REVERSE_CYCLE_MS = 100; + public static long SHOOT_FORWARD_CYCLE_MS = 1000; + public static long SHOOT_REVERSE_CYCLE_MS = 200; public static double INTAKE_FORWARD_SPEED = 1.0; - public static double INTAKE_REVERSE_SPEED = 0.45; + public static double INTAKE_REVERSE_SPEED = 0.5; + + // Pathing speed scaling for close/back-row intake moves + public static double INTAKE_PATH_SPEED_SCALING = 0.30; // Feeder timings/speeds during autonomous public static double FEEDER_SPEED = 1.0; // Time to spend shooting all preloads - public static long PRELOAD_SHOOT_TIME = 2000; + public static long PRELOAD_SHOOT_TIME = 2200; // Time to spend shooting intaked balls - public static long CYCLE_SHOOT_TIME = 2000; + public static long CYCLE_SHOOT_TIME = 2900; + + // Configurable delay between executed commands in milliseconds + public static long COMMAND_DELAY_MS = 160; + + // Configurable delay before the first shot to allow the flywheel to spin up in milliseconds + public static long SPIN_UP_DELAY_MS = 1300; + + // Constant to skip human player intake for back autos + public static boolean SKIP_HUMAN_INTAKE = true; private AutonomousConstants() {} } From 3237328e61c6eb220bd3b1dc6a36b17b4efbaeda Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:07:03 -0600 Subject: [PATCH 08/11] fix some points --- .../ftc/teamcode/constants/AutonomousPoints.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousPoints.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousPoints.java index 8bb0655..db69d75 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousPoints.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/AutonomousPoints.java @@ -1,16 +1,18 @@ package org.firstinspires.ftc.teamcode.constants; import com.pedropathing.geometry.Pose; +import com.bylazar.configurables.annotations.Configurable; +@Configurable public final class AutonomousPoints { public static final class Red { public static final class Back { - public static final Pose SHOOT = new Pose(7.79, -0.48, Math.toRadians(-113.76)); - public static final Pose INTAKE_CLOSE_1 = new Pose(26.77, -16.11, Math.toRadians(90.00)); - public static final Pose INTAKE_CLOSE_2 = new Pose(26.17, -39.70, Math.toRadians(90.00)); - public static final Pose INTAKE_MIDDLE_1 = new Pose(49.06, -17.78, Math.toRadians(90.00)); - public static final Pose INTAKE_MIDDLE_2 = new Pose(48.87, -39.57, Math.toRadians(90.00)); + public static final Pose SHOOT = new Pose(7.79, -0.48, Math.toRadians(-109.00)); + public static final Pose INTAKE_CLOSE_1 = new Pose(26.00, -2.0, Math.toRadians(90.00)); + public static final Pose INTAKE_CLOSE_2 = new Pose(26.00, -39.70, Math.toRadians(90.00)); + public static final Pose INTAKE_MIDDLE_1 = new Pose(50.00, -2.0, Math.toRadians(90.00)); + public static final Pose INTAKE_MIDDLE_2 = new Pose(50.00, -34.57, Math.toRadians(90.00)); public static final Pose INTAKE_HUMAN = new Pose(1.99, -44.98, Math.toRadians(70.94)); public static final Pose CLOSE_PARK = new Pose(29.91, -36.08, Math.toRadians(-90.00)); } @@ -18,9 +20,9 @@ public static final class Back { public static final class Front { public static final Pose SHOOT = new Pose(-49.65, -1.28, Math.toRadians(-83.59)); public static final Pose INTAKE_FAR_1 = new Pose(-40.99, -17.66, Math.toRadians(142.06)); - public static final Pose INTAKE_FAR_2 = new Pose(-22.61, -32.33, Math.toRadians(140.47)); + public static final Pose INTAKE_FAR_2 = new Pose(-22.61, -33.93, Math.toRadians(140.47)); public static final Pose INTAKE_MID_1 = new Pose(-54.56, -34.25, Math.toRadians(140.66)); - public static final Pose INTAKE_MID_2 = new Pose(-38.80, -49.29, Math.toRadians(139.87)); + public static final Pose INTAKE_MID_2 = new Pose(-38.80, -53.29, Math.toRadians(139.87)); public static final Pose PARK_FAR = new Pose(-31.36, 17.58, Math.toRadians(-41.80)); } } From 3570ce1e6ebaa28c17532ead97f91c1c7be3d229 Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:07:12 -0600 Subject: [PATCH 09/11] far and close shoot rpm --- .../firstinspires/ftc/teamcode/constants/ShooterConstants.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java index 6c5b11d..d3be760 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/constants/ShooterConstants.java @@ -15,6 +15,8 @@ public class ShooterConstants { public static double DEFAULT_TARGET_RPM = 4300.0; public static double MAX_TARGET_RPM = 6000.0; + public static double CYCLE_A_TARGET_RPM = 4300.0; + public static double CYCLE_B_TARGET_RPM = 4300.0; public static double FEEDER_MANUAL_POWER = 1.00; public static double FEEDER_INDEX_POWER = 0.15; From d6b7e1ac18de1842f530e487758f5b3d408c9acb Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:07:25 -0600 Subject: [PATCH 10/11] autocycle slot rpm swithcer --- .../ftc/teamcode/subsystems/AutoCycleSubsystem.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/AutoCycleSubsystem.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/AutoCycleSubsystem.java index ef88d6e..c17dd73 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/AutoCycleSubsystem.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/subsystems/AutoCycleSubsystem.java @@ -63,7 +63,10 @@ public boolean isActive() { } public double getSuggestedShooterRpm() { - return pathStarted ? ShooterConstants.DEFAULT_TARGET_RPM : 0.0; + if (!pathStarted) { + return 0.0; + } + return activeSlot == Slot.A ? ShooterConstants.CYCLE_A_TARGET_RPM : ShooterConstants.CYCLE_B_TARGET_RPM; } public double getSuggestedFeederPower() { From 63edbeb44a42b5f6b8d85d4eeba304bb590cdf1d Mon Sep 17 00:00:00 2001 From: YetAnotherNotHacking Date: Wed, 20 May 2026 13:08:02 -0600 Subject: [PATCH 11/11] rpm slot switcher connectors --- .../ftc/teamcode/teleop/BaseGoalTeleOp.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/BaseGoalTeleOp.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/BaseGoalTeleOp.java index a989ca8..628440c 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/BaseGoalTeleOp.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teleop/BaseGoalTeleOp.java @@ -7,6 +7,7 @@ import org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit; import org.firstinspires.ftc.teamcode.RobotContainer; +import org.firstinspires.ftc.teamcode.constants.AutoConstants; import org.firstinspires.ftc.teamcode.constants.HardwareConstants; import org.firstinspires.ftc.teamcode.constants.IntakeConstants; import org.firstinspires.ftc.teamcode.constants.ShooterConstants; @@ -17,6 +18,7 @@ public abstract class BaseGoalTeleOp extends OpMode { private boolean lastStart; private RevColorSensorV3 colorShootSensor; + private double lastActiveCycleRpm = ShooterConstants.DEFAULT_TARGET_RPM; protected abstract String getDriveTeamName(); @@ -38,6 +40,7 @@ public void start() { robot.drive.setBrakeMode(true); robot.shooter.setBrakeMode(false); robot.setFieldPose(0.0, 0.0, 0.0); + lastActiveCycleRpm = ShooterConstants.DEFAULT_TARGET_RPM; } @Override @@ -69,11 +72,7 @@ public void loop() { } if (robot.autoCycle.isActive()) { - if (robot.autoCycle.getSuggestedFeederPower() > 0.0) { - robot.intake.stop(); - } else { - robot.intake.runFromTrigger(1.0); - } + robot.intake.runFromTrigger(AutoConstants.CYCLE_INTAKE_POWER); } else { if (gamepad1.left_bumper) { robot.intake.reverse(IntakeConstants.BUMPER_REVERSE_POWER); @@ -85,11 +84,12 @@ public void loop() { double shooterTargetRpm; if (robot.autoCycle.isActive()) { shooterTargetRpm = robot.autoCycle.getSuggestedShooterRpm(); + lastActiveCycleRpm = shooterTargetRpm; } else if (gamepad1.right_trigger > ShooterConstants.SHOOTER_TRIGGER_DEADBAND) { - shooterTargetRpm = ShooterConstants.DEFAULT_TARGET_RPM - + (gamepad1.right_trigger * (ShooterConstants.MAX_TARGET_RPM - ShooterConstants.DEFAULT_TARGET_RPM)); + shooterTargetRpm = lastActiveCycleRpm + + (gamepad1.right_trigger * (ShooterConstants.MAX_TARGET_RPM - lastActiveCycleRpm)); } else { - shooterTargetRpm = ShooterConstants.DEFAULT_TARGET_RPM; + shooterTargetRpm = lastActiveCycleRpm; } int alpha = -1;