From 6a6f55d1307dc33a8478b0aee13456cc83cae224 Mon Sep 17 00:00:00 2001 From: mixxlto Date: Wed, 21 Jan 2026 16:53:44 -0800 Subject: [PATCH] fdsa --- .../java/frc/robot/commands/gpm/TurretJoyStickAim.java | 4 ++-- .../frc/robot/controls/PS5ControllerDriverConfig.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java b/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java index 8be9b99..6c31a36 100644 --- a/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java +++ b/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java @@ -4,12 +4,12 @@ import edu.wpi.first.math.MathUtil; import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.math.util.Units; import edu.wpi.first.wpilibj2.command.Command; -import frc.robot.controls.BaseDriverConfig; +import frc.robot.controls.PS5ControllerDriverConfig; import frc.robot.subsystems.turret.Turret; public class TurretJoyStickAim extends Command{ private Turret turret; - private BaseDriverConfig driver; + private PS5ControllerDriverConfig driver; public TurretJoyStickAim(Turret turret){ this.turret = turret; diff --git a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java index 8c15939..037efb8 100644 --- a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java +++ b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java @@ -92,12 +92,14 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig { driver.get(PS5Button.CROSS).onTrue( new InstantCommand(()->{ - turretAutoShoot = new TurretAutoShoot(turret, getDrivetrain()); - CommandScheduler.getInstance().schedule(turretAutoShoot); + if (turretJoyStickAim == null || !turretJoyStickAim.isScheduled()){ + turretJoyStickAim = new TurretJoyStickAim(turret, this.driver); + CommandScheduler.getInstance().schedule(turretAutoShoot); + } }) ).onFalse( new InstantCommand(()->{ - turretAutoShoot.cancel(); + turretJoyStickAim.cancel(); }) ); } -- 2.39.5