Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
chore: Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenheroux committed Jan 14, 2024
1 parent 90ce586 commit b4ca426
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/main/java/frc/lib/Telemetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,26 @@ public static void addFullscreen(ShuffleboardTab tab, String title, Sendable sen

/**
* Adds swerve module states to a Shuffleboard tab.
*
*
* @param tab the Shuffleboard tab to add the swerve module states to.
* @param title the title of the swerve module states.
* @param swerveModuleStatesSupplier a supplier for swerve module states.
*/
public static void addSwerveModuleStates(ShuffleboardTab tab, String title, Supplier<SwerveModuleState[]> swerveModuleStatesSupplier) {
tab.addDoubleArray(title, () -> {
SwerveModuleState[] states = swerveModuleStatesSupplier.get();
double[] doubles = new double[8];
public static void addSwerveModuleStates(
ShuffleboardTab tab, String title, Supplier<SwerveModuleState[]> swerveModuleStatesSupplier) {
tab.addDoubleArray(
title,
() -> {
SwerveModuleState[] states = swerveModuleStatesSupplier.get();
double[] doubles = new double[8];

for (int i = 0; i < 4; i++) {
SwerveModuleState state = states[i];
doubles[2 * i] = state.angle.getDegrees();
doubles[2 * i + 1] = state.speedMetersPerSecond;
}
for (int i = 0; i < 4; i++) {
SwerveModuleState state = states[i];
doubles[2 * i] = state.angle.getDegrees();
doubles[2 * i + 1] = state.speedMetersPerSecond;
}

return doubles;
});
return doubles;
});
}
}

0 comments on commit b4ca426

Please sign in to comment.