From: maxwtan <100314265+MaxwellTTan20@users.noreply.github.com> Date: Sat, 21 Feb 2026 19:07:02 +0000 (-0800) Subject: fix calibration X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=2e9696ab7106f46f158c0fc56a144db466ed2444;p=FRC2026.git fix calibration --- diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 0d778f5..90d8395 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -95,8 +95,8 @@ public class RobotContainer { case WaffleHouse: // AKA Betabot // turret = new Turret(); - // shooter = new Shooter(); - // hood = new Hood(); + shooter = new Shooter(); + hood = new Hood(); case SwerveCompetition: // AKA "Vantage" diff --git a/src/main/java/frc/robot/commands/gpm/ClimbCommand.java b/src/main/java/frc/robot/commands/gpm/ClimbCommand.java index 932fab9..33047e0 100644 --- a/src/main/java/frc/robot/commands/gpm/ClimbCommand.java +++ b/src/main/java/frc/robot/commands/gpm/ClimbCommand.java @@ -18,7 +18,8 @@ public class ClimbCommand extends SequentialCommandGroup{ new InstantCommand(() -> climb.goUp()), new DriveToPose(drive, () -> FieldConstants.getClimbLocation()) ), - new InstantCommand(() -> controller.setRumble(GenericHID.RumbleType.kBothRumble, 1.0)) + // TODO: Make it stop rumbling after like a second + new InstantCommand(() -> controller.setRumble(GenericHID.RumbleType.kBothRumble, 1.0)) ); } diff --git a/src/main/java/frc/robot/constants/IntakeConstants.java b/src/main/java/frc/robot/constants/IntakeConstants.java index 0cba508..5a7720a 100644 --- a/src/main/java/frc/robot/constants/IntakeConstants.java +++ b/src/main/java/frc/robot/constants/IntakeConstants.java @@ -21,9 +21,9 @@ public class IntakeConstants { /** max extension in inches */ - public static final double MAX_EXTENSION = 10.0; // inches + public static final double MAX_EXTENSION = 10.0 - 2.0; // inches - public static final double INTERMEDIATE_EXTENSION = 5.0; //inches + public static final double INTERMEDIATE_EXTENSION = 5.0 - 2.0; //inches public static final double STOW_EXTENSION = 0.2; // inches diff --git a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java index f4d0bcc..44d7083 100644 --- a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java +++ b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java @@ -122,12 +122,19 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig { })); } + // Climb if (climb != null) { + // Calibration driver.get(PS5Button.PS).onTrue(new InstantCommand(() -> { climb.hardstopCalibration(); })).onFalse(new InstantCommand(() -> { climb.stopCalibrating(); })); + + // Climb climb + driver.get(PS5Button.LEFT_TRIGGER).onTrue(new InstantCommand(()-> { + climb.goDown(); + })); } } diff --git a/src/main/java/frc/robot/subsystems/Intake/Intake.java b/src/main/java/frc/robot/subsystems/Intake/Intake.java index 39bb7fc..47f42ca 100644 --- a/src/main/java/frc/robot/subsystems/Intake/Intake.java +++ b/src/main/java/frc/robot/subsystems/Intake/Intake.java @@ -145,14 +145,6 @@ public class Intake extends SubsystemBase implements IntakeIO{ // add some test commands. SmartDashboard.putData("Extension Mechanism", mechanism); - SmartDashboard.putData("START INTAKE COMMAND", new InstantCommand(()->{ - extend(); - spinStart(); - })); - SmartDashboard.putData("END INTAKE COMMAND", new InstantCommand(()->{ - intermediateExtend(); - spinStop(); - })); if (RobotBase.isSimulation()) { // Extender simulation @@ -356,6 +348,8 @@ public class Intake extends SubsystemBase implements IntakeIO{ */ public void stopCalibrating(){ zeroMotors(); + leftMotor.set(0); + rightMotor.set(0); setCurrentLimits(IntakeConstants.EXTENDER_CURRENT_LIMITS); calibrating = false; retract(); @@ -366,17 +360,14 @@ public class Intake extends SubsystemBase implements IntakeIO{ * @param limit the current limit for stator and supply current */ public void setCurrentLimits(double limit) { - TalonFXConfiguration config = new TalonFXConfiguration(); - - config.CurrentLimits = new CurrentLimitsConfigs(); - - config.CurrentLimits.StatorCurrentLimitEnable = true; - config.CurrentLimits.StatorCurrentLimit = limit; - config.CurrentLimits.SupplyCurrentLimitEnable = true; - config.CurrentLimits.SupplyCurrentLimit = limit; + CurrentLimitsConfigs limits = new CurrentLimitsConfigs() + .withStatorCurrentLimitEnable(true) + .withStatorCurrentLimit(limit) + .withSupplyCurrentLimitEnable(true) + .withSupplyCurrentLimit(limit); - leftMotor.getConfigurator().apply(config); - rightMotor.getConfigurator().apply(config); + leftMotor.getConfigurator().apply(limits); + rightMotor.getConfigurator().apply(limits); } @Override diff --git a/src/main/java/frc/robot/subsystems/hood/Hood.java b/src/main/java/frc/robot/subsystems/hood/Hood.java index 66aef05..c9ffa10 100644 --- a/src/main/java/frc/robot/subsystems/hood/Hood.java +++ b/src/main/java/frc/robot/subsystems/hood/Hood.java @@ -36,7 +36,7 @@ public class Hood extends SubsystemBase implements HoodIO{ motor.setNeutralMode(NeutralModeValue.Brake); TalonFXConfiguration config = new TalonFXConfiguration(); - config.MotorOutput.Inverted = InvertedValue.Clockwise_Positive; + config.MotorOutput.Inverted = InvertedValue.CounterClockwise_Positive; config.Slot0.kP = 2.0; config.Slot0.kS = 0.1; // Static friction compensation