From dfdfb25627eb6eef57fec8a1b62a9568c91d6931 Mon Sep 17 00:00:00 2001 From: mixxlto Date: Wed, 21 Jan 2026 16:56:05 -0800 Subject: [PATCH] fdas --- .../frc/robot/commands/gpm/TurretJoyStickAim.java | 3 ++- .../robot/controls/PS5ControllerDriverConfig.java | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java b/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java index 6c31a36..90e8be2 100644 --- a/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java +++ b/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java @@ -11,8 +11,9 @@ public class TurretJoyStickAim extends Command{ private Turret turret; private PS5ControllerDriverConfig driver; - public TurretJoyStickAim(Turret turret){ + public TurretJoyStickAim(Turret turret, PS5ControllerDriverConfig driver){ this.turret = turret; + this.driver = driver; } Rotation2d rotation2d = new Rotation2d(driver.getRawSideTranslation(), driver.getRawForwardTranslation()); diff --git a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java index 037efb8..3f1a136 100644 --- a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java +++ b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java @@ -92,14 +92,16 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig { driver.get(PS5Button.CROSS).onTrue( new InstantCommand(()->{ - if (turretJoyStickAim == null || !turretJoyStickAim.isScheduled()){ - turretJoyStickAim = new TurretJoyStickAim(turret, this.driver); - CommandScheduler.getInstance().schedule(turretAutoShoot); - } - }) + if (turretJoyStickAim == null || !turretJoyStickAim.isScheduled()){ + turretJoyStickAim = new TurretJoyStickAim(turret, this); + CommandScheduler.getInstance().schedule(turretAutoShoot); + } + }) ).onFalse( new InstantCommand(()->{ - turretJoyStickAim.cancel(); + if(turretJoyStickAim.isScheduled()){ + turretJoyStickAim.cancel(); + } }) ); } -- 2.39.5