import frc.robot.commands.gpm.RunSpindexer;
import frc.robot.commands.gpm.Superstructure;
import frc.robot.constants.Constants;
+import frc.robot.constants.swerve.DriveConstants;
import frc.robot.subsystems.Climb.LinearClimb;
import frc.robot.subsystems.Intake.Intake;
import frc.robot.subsystems.drivetrain.Drivetrain;
import frc.robot.subsystems.hood.Hood;
import frc.robot.subsystems.shooter.Shooter;
import frc.robot.subsystems.spindexer.Spindexer;
+import frc.robot.subsystems.spindexer.SpindexerConstants;
import frc.robot.subsystems.turret.Turret;
import lib.controllers.PS5Controller;
import lib.controllers.PS5Controller.DPad;
hood.forceHoodDown(false);
}));
}
+
+ // Hood
+ if (spindexer != null) {
+ // Set the hood down -- for safety measures under trench
+ controller.get(PS5Button.RB).onTrue(new InstantCommand(() -> shootFocus(true)))
+ .onFalse(new InstantCommand(()-> shootFocus(false)));
+ }
+ }
+
+ private void shootFocus(boolean turnOn) {
+ if (turnOn) {
+ System.out.println("Shooting is now Focused");
+ spindexer.setNewCurrentLimit(SpindexerConstants.currentLimit * 2.5);
+ drive.applyNewModuleCurrents(DriveConstants.STEER_PEAK_CURRENT_LIMIT, DriveConstants.DRIVE_PEAK_CURRENT_LIMIT * 0.25
+ );
+ } else {
+ System.out.println("Shooting back to normal (From focus)");
+ spindexer.setNewCurrentLimit(SpindexerConstants.currentLimit);
+ drive.applyNewModuleCurrents(DriveConstants.STEER_PEAK_CURRENT_LIMIT, DriveConstants.DRIVE_PEAK_CURRENT_LIMIT);
+ }
}
@Override
public void setNewCurrentLimit(double newCurrentLimit) {
CurrentLimitsConfigs limitConfig = new CurrentLimitsConfigs();
- limitConfig.StatorCurrentLimit = SpindexerConstants.CURRENT_SPIKE_LIMIT;
+ limitConfig.StatorCurrentLimit = newCurrentLimit;
limitConfig.StatorCurrentLimitEnable = true;
limitConfig.SupplyCurrentLowerLimit = newCurrentLimit;
limitConfig.SupplyCurrentLowerTime = 1.5;