]> git.taranathan.com Git - FRC2026.git/commitdiff
Update Intake.java
authorShaurya Piplani <pips9004@lgsstudent.org>
Sun, 15 Feb 2026 19:06:42 +0000 (11:06 -0800)
committerShaurya Piplani <pips9004@lgsstudent.org>
Sun, 15 Feb 2026 19:06:42 +0000 (11:06 -0800)
config for for roller motor

src/main/java/frc/robot/subsystems/Intake/Intake.java

index 9fbc76e8f0467abd4b5713e07eace8f7196cd69b..0146a086de245a9d4c76d1caa3769fe0d5704fc0 100644 (file)
@@ -70,19 +70,18 @@ public class Intake extends SubsystemBase {
         maxAcceleration = maxVelocity / 0.25;
 
         // Configure the motors
-
-        // Build the configuration
-        TalonFXConfiguration config = new TalonFXConfiguration();
+        // Build the configuration for the roller
+        TalonFXConfiguration rollerConfig = new TalonFXConfiguration();
 
         // config the current limits (low value for testing)
-        config.CurrentLimits
+        rollerConfig.CurrentLimits
         .withStatorCurrentLimit(3.0)
         .withStatorCurrentLimitEnable(true)
         .withSupplyCurrentLimit(3.0)
         .withSupplyCurrentLimitEnable(true);
 
         // config Slot 0 PID params
-        var slot0Configs = config.Slot0;
+        var slot0Configs = rollerConfig.Slot0;
         // TODO: set PID parameters
         slot0Configs.kP = 5.0;
         slot0Configs.kI = 0.0;
@@ -90,6 +89,31 @@ public class Intake extends SubsystemBase {
         slot0Configs.kV = 0.0;
         slot0Configs.kA = 0.0;
 
+        // set the brake mode
+        rollerConfig.MotorOutput.withNeutralMode(NeutralModeValue.Brake);
+
+        // apply the configuration to the right motor (master)
+        rollerMotor.getConfigurator().apply(rollerConfig);
+
+        // Build the configuration for the left and right Motor
+        TalonFXConfiguration config = new TalonFXConfiguration();
+
+        // config the current limits (low value for testing)
+        config.CurrentLimits
+        .withStatorCurrentLimit(3.0)
+        .withStatorCurrentLimitEnable(true)
+        .withSupplyCurrentLimit(3.0)
+        .withSupplyCurrentLimitEnable(true);
+
+        // config Slot 0 PID params
+        var rollerSlot0Configs = config.Slot0;
+        // TODO: set PID parameters
+        rollerSlot0Configs.kP = 5.0;
+        rollerSlot0Configs.kI = 0.0;
+        rollerSlot0Configs.kD = 0.0;
+        rollerSlot0Configs.kV = 0.0;
+        rollerSlot0Configs.kA = 0.0;
+
         // configure MotionMagic
         MotionMagicConfigs motionMagicConfigs = config.MotionMagic;