From: moo Date: Tue, 21 Apr 2026 22:38:45 +0000 (-0700) Subject: dynamic works X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=5febfc1b986dc65670dad7370de839ce5f51983a;p=FRC2026.git dynamic works --- diff --git a/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java b/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java index 1bbd748..09461d5 100644 --- a/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java +++ b/src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java @@ -138,8 +138,6 @@ public class DynamicAutoBuilder { } private Command startShootingCommand() { - return new InstantCommand(() -> { - new InstantCommand(() -> hood.forceHoodDown(false)); - }); + return new InstantCommand(() -> hood.forceHoodDown(false)); } } diff --git a/src/main/java/frc/robot/commands/gpm/RunSpindexerWithStop.java b/src/main/java/frc/robot/commands/gpm/RunSpindexerWithStop.java index 71c3f5e..2a08f33 100644 --- a/src/main/java/frc/robot/commands/gpm/RunSpindexerWithStop.java +++ b/src/main/java/frc/robot/commands/gpm/RunSpindexerWithStop.java @@ -38,6 +38,8 @@ public class RunSpindexerWithStop extends Command { private Timer runTimer = new Timer(); private boolean seizing; + + private Debouncer debouncer = new Debouncer(0.3, DebounceType.kRising); public RunSpindexerWithStop(Spindexer spindexer, Turret turret, Hood hood, Intake intake) { this.spindexer = spindexer; @@ -123,6 +125,6 @@ public class RunSpindexerWithStop extends Command { @Override public boolean isFinished() { - return spindexer.spinningAir() && runTimer.hasElapsed(1.0); + return runTimer.hasElapsed(1.0) && debouncer.calculate(spindexer.spinningAir()); } } diff --git a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java index 6a7caa8..3569dba 100644 --- a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java +++ b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java @@ -11,6 +11,7 @@ import frc.robot.Robot; import frc.robot.commands.gpm.IntakeMovementCommand; import frc.robot.commands.gpm.ReverseMotors; import frc.robot.commands.gpm.RunSpindexer; +import frc.robot.commands.gpm.RunSpindexerWithStop; import frc.robot.commands.gpm.Superstructure; import frc.robot.constants.Constants; import frc.robot.subsystems.Intake.Intake; @@ -124,7 +125,7 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig { // Toggle spindexer controller.get(PS5Button.LEFT_TRIGGER).toggleOnTrue( - new RunSpindexer(spindexer, turret, hood, intake) + new RunSpindexerWithStop(spindexer, turret, hood, intake) ); } diff --git a/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java b/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java index 08c4492..7eb4459 100644 --- a/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java +++ b/src/main/java/frc/robot/subsystems/spindexer/Spindexer.java @@ -31,9 +31,9 @@ public class Spindexer extends SubsystemBase implements SpindexerIO { // configure current limit CurrentLimitsConfigs limitConfig = new CurrentLimitsConfigs(); - limitConfig.StatorCurrentLimit = SpindexerConstants.SUPPLY_CURRENT_LIMIT; + limitConfig.StatorCurrentLimit = SpindexerConstants.CURRENT_FORWARD_STATOR_LIMIT; limitConfig.StatorCurrentLimitEnable = true; - limitConfig.SupplyCurrentLowerLimit = SpindexerConstants.CURRENT_FORWARD_STATOR_LIMIT; + limitConfig.SupplyCurrentLowerLimit = SpindexerConstants.SUPPLY_CURRENT_LIMIT; limitConfig.SupplyCurrentLimitEnable = true; motorOne.getConfigurator().apply(limitConfig); motorTwo.getConfigurator().apply(limitConfig);