Skip to content

Commit

Permalink
Apply Prettier format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 4, 2024
1 parent 9df4a25 commit 07be015
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ public static final class AmpBar {
}

public static final class Drive {

public static final PIDConstants HEADING_CORRECTION_PID = new PIDConstants(0.01, 0, 0);

public static final double DISCRETIZE_TIME_SECONDS = 0.02;
Expand Down Expand Up @@ -254,7 +255,7 @@ public static final class Module {
public static final FFConstants SIM_FF = new FFConstants(0.0, 0.13);
public static final PIDConstants SIM_DRIVE_PID = new PIDConstants(0.1, 0.0, 0.0);
public static final PIDConstants SIM_TURN_PID = new PIDConstants(10.0, 0.0, 0.0);

// Hope this works??? This should be tuned using SYSID or Power, I, and Damping method
public static final FFConstants REAL_FF = new FFConstants(0, 0);
// TODO: Test 0.0020645, 0.0, 0.0 (YAGSL configs)
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/frc/robot/subsystems/drive/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ public Drive(
lastHeadingRadians = poseEstimator.getEstimatedPosition().getRotation().getRadians();
headingCorrectionEnabled = true;
// TODO: Tune
headingCorrectionController = new PIDController(Constants.Drive.HEADING_CORRECTION_PID.kP, Constants.Drive.HEADING_CORRECTION_PID.kI, Constants.Drive.HEADING_CORRECTION_PID.kD);
headingCorrectionController = new PIDController(
Constants.Drive.HEADING_CORRECTION_PID.kP,
Constants.Drive.HEADING_CORRECTION_PID.kI,
Constants.Drive.HEADING_CORRECTION_PID.kD
);

this.gyroIO = gyroIO;
modules[0] = new Module(flModuleIO, 0);
Expand Down Expand Up @@ -306,7 +310,10 @@ public void periodic() {
*/
public void runVelocity(ChassisSpeeds speeds) {
// Calculate module setpoints
ChassisSpeeds discreteSpeeds = ChassisSpeeds.discretize(speeds, Constants.Drive.DISCRETIZE_TIME_SECONDS);
ChassisSpeeds discreteSpeeds = ChassisSpeeds.discretize(
speeds,
Constants.Drive.DISCRETIZE_TIME_SECONDS
);
SwerveModuleState[] setpointStates = kinematics.toSwerveModuleStates(discreteSpeeds);
SwerveDriveKinematics.desaturateWheelSpeeds(
setpointStates,
Expand Down

0 comments on commit 07be015

Please sign in to comment.