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