Upgrading to 2025.1.0

This commit is contained in:
thenetworkgrinch
2024-12-09 23:26:04 +00:00
parent 9fe6551d88
commit 4bc6978a20
35 changed files with 1902 additions and 1122 deletions

View File

@@ -2,8 +2,6 @@ package swervelib.parser.json.modules;
import edu.wpi.first.math.util.Units;
import swervelib.math.SwerveMath;
import swervelib.telemetry.Alert;
import swervelib.telemetry.Alert.AlertType;
/**
* Drive motor composite JSON parse class.
@@ -14,15 +12,15 @@ public class DriveConversionFactorsJson
/**
* Gear ratio for the drive motor rotations to turn the wheel 1 complete rotation.
*/
public double gearRatio = 0;
public double gearRatio;
/**
* Diameter of the wheel in inches.
*/
public double diameter = 0;
public double diameter;
/**
* Calculated conversion factor.
*/
public double factor = 0;
public double factor = 0;
/**
* Calculate the drive conversion factor.
@@ -31,12 +29,6 @@ public class DriveConversionFactorsJson
*/
public double calculate()
{
if (factor != 0 && (diameter != 0 || gearRatio != 0))
{
new Alert("Configuration",
"The given drive conversion factor takes precedence over the composite conversion factor, please remove 'factor' if you want to use the composite factor instead.",
AlertType.WARNING).set(true);
}
if (factor == 0)
{
factor = SwerveMath.calculateMetersPerRotation(Units.inchesToMeters(this.diameter), this.gearRatio);