]> git.taranathan.com Git - FRC2026.git/commitdiff
fix calibration
authormaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Sat, 21 Feb 2026 19:07:02 +0000 (11:07 -0800)
committermaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Sat, 21 Feb 2026 19:07:02 +0000 (11:07 -0800)
src/main/java/frc/robot/RobotContainer.java
src/main/java/frc/robot/commands/gpm/ClimbCommand.java
src/main/java/frc/robot/constants/IntakeConstants.java
src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java
src/main/java/frc/robot/subsystems/Intake/Intake.java
src/main/java/frc/robot/subsystems/hood/Hood.java

index 0d778f55542c11d85c98f78356ac355d746833d0..90d8395b280f0bf4015dbdf7e28034139ac1f98d 100644 (file)
@@ -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"
 
index 932fab914bc482d9acaf7bcd586d22228e60d237..33047e0aacdcfdf8002994545774411296eae935 100644 (file)
@@ -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)) 
         );
     }
 
index 0cba508b784fb364a68ab07796164110384ac02a..5a7720ae1ad5f2015d0b4f8d71e787602794a0ea 100644 (file)
@@ -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
 
index f4d0bcc8d5c40313b535e97fc401cbb1c46aa3ca..44d70834375cf522c524e1af665fcf17db4e8d8b 100644 (file)
@@ -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();
+            }));
         }
     }
 
index 39bb7fcb9440e88bda84cdf561cf793acabdbfb9..47f42cad2bdec03a54b4e19f80723da3056fa2de 100644 (file)
@@ -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
index 66aef054f600a580a6edb7683856cb16cebc92e5..c9ffa107d401a3af61f845e91681610bb66f8e6f 100644 (file)
@@ -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