]> git.taranathan.com Git - FRC2026.git/commitdiff
current limit and stuff
authorWesleyWong-972 <wesleycwong@gmail.com>
Mon, 23 Mar 2026 22:23:05 +0000 (15:23 -0700)
committerWesleyWong-972 <wesleycwong@gmail.com>
Mon, 23 Mar 2026 22:23:05 +0000 (15:23 -0700)
src/main/java/frc/robot/constants/swerve/DriveConstants.java
src/main/java/frc/robot/subsystems/shooter/Shooter.java
src/main/java/frc/robot/subsystems/shooter/ShooterConstants.java

index f39931fbfd86e2dd04fc7332d02036dbae858563..5d69304cc442a9c9785767716677b41be0a93880 100644 (file)
@@ -53,7 +53,7 @@ public class DriveConstants {
         // To do so, divide by the radius. The radius is the diagonal of the square chassis, diagonal = sqrt(2) * side_length.
         public static final double MAX_ANGULAR_SPEED = MAX_SPEED / ((TRACK_WIDTH / 2) * Math.sqrt(2));
     
-        public static final double COSF = 1.5;
+        public static final double COSF = 2.255;
         
         // The maximum acceleration of the robot, limited by friction
         public static final double MAX_LINEAR_ACCEL = COSF * Constants.GRAVITY_ACCELERATION;
index 024c11f0d8c3ed3331af992aeb84a1838575bc15..10969cdafc7734a01678b1fadf674122c1541a08 100644 (file)
@@ -16,6 +16,7 @@ import edu.wpi.first.wpilibj2.command.InstantCommand;
 import edu.wpi.first.wpilibj2.command.SubsystemBase;
 import frc.robot.constants.Constants;
 import frc.robot.constants.IdConstants;
+import frc.robot.constants.IntakeConstants;
 import frc.robot.util.HubActive;
 
 public class Shooter extends SubsystemBase implements ShooterIO {
@@ -38,7 +39,7 @@ public class Shooter extends SubsystemBase implements ShooterIO {
 
     double powerModifier = 1.05; // TESTED
 
-    public Shooter(){
+    public Shooter() {
         updateInputs();
         
         TalonFXConfiguration config = new TalonFXConfiguration();
@@ -46,6 +47,11 @@ public class Shooter extends SubsystemBase implements ShooterIO {
         config.Slot0.kI = 0;
         config.Slot0.kD = 0.0;
         config.Slot0.kV = 0.125; //Maximum rps = 100 --> 12V/100rps
+
+        config.CurrentLimits
+        .withSupplyCurrentLimit(ShooterConstants.SHOOTER_CURRENT_LIMIT)
+        .withSupplyCurrentLimitEnable(true);
+
         shooterMotorLeft.getConfigurator().apply(config);
         shooterMotorRight.getConfigurator().apply(config);
         
index e320c5518f4dfd5894e6b5dae7d2463b742b4e72..66444266f64081602a28048ea4f601e3245b22d8 100644 (file)
@@ -5,4 +5,5 @@ import edu.wpi.first.math.util.Units;
 public class ShooterConstants {
     public static final double SHOOTER_VELOCITY = 1.0;
     public static final double SHOOTER_LAUNCH_DIAMETER = Units.inchesToMeters(4.0);
+    public static final double SHOOTER_CURRENT_LIMIT = 80;
 }