From: mixxlto Date: Thu, 22 Jan 2026 00:56:05 +0000 (-0800) Subject: fdas X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=dfdfb25627eb6eef57fec8a1b62a9568c91d6931;p=FRC2026.git fdas --- 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(); + } }) ); }