Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved readability of DRIVE_WHEEL_TYPE enum #14

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -630,16 +630,14 @@ public double getModuleMaxAccelerationMPSsq(double robotMass, int modulesCount)
/ robotMass;
}

public enum DRIVE_WHEEL_TYPE {
RUBBER,
TIRE
}
public enum WHEEL_GRIP {
RUBBER_WHEEL_GRIP(1.25),
TIRE_WHEEL_GRIP(1.15);

private static double getWheelGripping(DRIVE_WHEEL_TYPE type) {
return switch (type) {
case RUBBER -> 1.25;
case TIRE -> 1.15;
};
public final double grip;
WHEEL_GRIP(double grip){
this.grip = grip;
}
}

/**
Expand All @@ -651,7 +649,7 @@ public static Supplier<SwerveModuleSimulation> getMark4(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -669,7 +667,7 @@ public static Supplier<SwerveModuleSimulation> getMark4(
12.8,
0.2,
0.3,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(2),
0.03);
}
Expand All @@ -683,7 +681,7 @@ public static Supplier<SwerveModuleSimulation> getMark4i(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -701,7 +699,7 @@ public static Supplier<SwerveModuleSimulation> getMark4i(
150.0 / 7.0,
0.2,
1,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(2),
0.025);
}
Expand All @@ -714,7 +712,7 @@ public static Supplier<SwerveModuleSimulation> getMark4n(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -731,7 +729,7 @@ public static Supplier<SwerveModuleSimulation> getMark4n(
18.75,
0.25,
1,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(2),
0.025);
}
Expand All @@ -748,7 +746,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveX(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -771,7 +769,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveX(
11.3142,
0.2,
0.3,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(2),
0.03);
}
Expand All @@ -788,7 +786,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveXFlipped(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -811,7 +809,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveXFlipped(
11.3714,
0.2,
0.3,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(2),
0.03);
}
Expand All @@ -827,7 +825,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveXS(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -847,7 +845,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveXS(
41.25,
0.2,
0.3,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(1.5),
0.03);
}
Expand All @@ -865,7 +863,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveX2(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -891,7 +889,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveX2(
12.1,
0.2,
0.3,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(2),
0.03);
}
Expand All @@ -908,7 +906,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveX2S(
DCMotor driveMotor,
DCMotor steerMotor,
double driveCurrentLimitAmps,
DRIVE_WHEEL_TYPE driveWheelType,
WHEEL_GRIP driveWheelType,
int gearRatioLevel) {
return () ->
new SwerveModuleSimulation(
Expand All @@ -931,7 +929,7 @@ public static Supplier<SwerveModuleSimulation> getSwerveX2S(
25.9,
0.2,
0.3,
getWheelGripping(driveWheelType),
driveWheelType.grip,
Units.inchesToMeters(1.875),
0.03);
}
Expand Down