Skip to content

Commit

Permalink
Merge branch 'GRC-Practice-Day-Tuning' of https://github.com/FRC-7525…
Browse files Browse the repository at this point in the history
…/2024-Rewrite into GRC-Practice-Day-Tuning
  • Loading branch information
GreenTomato5 committed Oct 4, 2024
2 parents c92949b + 89f8cbe commit 9521c68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* constants are needed, to reduce verbosity.
*/
public final class Constants {

public static final double GRAVITY = 9.81;
public static final double SIM_UPDATE_TIME = 0.05;

Expand Down
11 changes: 9 additions & 2 deletions src/main/java/frc/robot/subsystems/drive/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ public Module(ModuleIO io, int index) {
// any PID/FF values for controllers idk why
case REAL:
// TODO: TEST THIS
driveFeedforward = createDriveFeedforward(Constants.Drive.OPTIMAL_VOLTAGE, Constants.Drive.MAX_LINEAR_SPEED, Constants.Drive.WHEEL_GRIP_COEFFICIENT_OF_FRICTION);
driveFeedforward = createDriveFeedforward(
Constants.Drive.OPTIMAL_VOLTAGE,
Constants.Drive.MAX_LINEAR_SPEED,
Constants.Drive.WHEEL_GRIP_COEFFICIENT_OF_FRICTION
);
driveFeedback = new PIDController(
Constants.Drive.Module.REAL_DRIVE_PID.kP,
Constants.Drive.Module.REAL_DRIVE_PID.kI,
Expand Down Expand Up @@ -211,7 +215,10 @@ public static void antiJitter(
SwerveModuleState lastModuleState,
double maxSpeed
) {
if (Math.abs(moduleState.speedMetersPerSecond) <= (maxSpeed * Constants.Drive.ANTI_JITTER_DRIVE_THRESHOLD)) {
if (
Math.abs(moduleState.speedMetersPerSecond) <=
(maxSpeed * Constants.Drive.ANTI_JITTER_DRIVE_THRESHOLD)
) {
moduleState.angle = lastModuleState.angle;
}
}
Expand Down

0 comments on commit 9521c68

Please sign in to comment.