]> git.taranathan.com Git - FRC2026.git/commitdiff
enable feedforward, set closed loop to 0
authoriefomit <timofei.stem@gmail.com>
Mon, 23 Mar 2026 23:06:08 +0000 (16:06 -0700)
committeriefomit <timofei.stem@gmail.com>
Mon, 23 Mar 2026 23:06:08 +0000 (16:06 -0700)
src/main/java/frc/robot/subsystems/drivetrain/Module.java

index d0ada94d1fa5f92005fed2878c0da229c14e6976..e62c922d65f4c4049d07f27e9f7c0bdb93bc2844 100644 (file)
@@ -252,10 +252,11 @@ public class Module implements ModuleIO{
             double velocity = desiredState.speedMetersPerSecond/DriveConstants.WHEEL_RADIUS/2/Math.PI*DriveConstants.DRIVE_GEAR_RATIO;
             Logger.recordOutput("desired vel" + moduleConstants.ordinal(), velocity);
             
+            double feedforward = desiredState.speedMetersPerSecond * moduleConstants.getDriveV();
             driveMotor.setControl(
                 velocityRequest
-                    .withVelocity(velocity));
-                    ///.withFeedForward(feedforward));
+                    .withVelocity(velocity)
+                    .withFeedForward(feedforward));
         }     
     }
 
@@ -365,7 +366,7 @@ public class Module implements ModuleIO{
         driveMotor.getConfigurator().apply(config);
         driveMotor.getConfigurator().apply(new MotorOutputConfigs().withInverted(DriveConstants.INVERT_DRIVE_MOTOR));
         driveMotor.getConfigurator().apply(new OpenLoopRampsConfigs().withDutyCycleOpenLoopRampPeriod(DriveConstants.OPEN_LOOP_RAMP));
-        driveMotor.getConfigurator().apply(new ClosedLoopRampsConfigs().withDutyCycleClosedLoopRampPeriod(DriveConstants.OPEN_LOOP_RAMP));
+        driveMotor.getConfigurator().apply(new ClosedLoopRampsConfigs().withDutyCycleClosedLoopRampPeriod(0.0));
         driveMotor.setNeutralMode(DriveConstants.DRIVE_NEUTRAL_MODE);
         
     }