}
private Command startShootingCommand() {
- return new InstantCommand(() -> {
- new InstantCommand(() -> hood.forceHoodDown(false));
- });
+ return new InstantCommand(() -> hood.forceHoodDown(false));
}
}
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;
@Override
public boolean isFinished() {
- return spindexer.spinningAir() && runTimer.hasElapsed(1.0);
+ return runTimer.hasElapsed(1.0) && debouncer.calculate(spindexer.spinningAir());
}
}
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;
// Toggle spindexer
controller.get(PS5Button.LEFT_TRIGGER).toggleOnTrue(
- new RunSpindexer(spindexer, turret, hood, intake)
+ new RunSpindexerWithStop(spindexer, turret, hood, intake)
);
}
// 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);