Updated to 2024.4.6.1

This commit is contained in:
thenetworkgrinch
2024-01-22 15:11:18 -06:00
parent 7c76cffc78
commit a20a6b83af
120 changed files with 923 additions and 603 deletions

View File

@@ -19,10 +19,6 @@ public class SwerveDriveConfiguration
* Swerve IMU
*/
public SwerveIMU imu;
/**
* Invert the imu measurements.
*/
public boolean invertedIMU = false;
/**
* Number of modules on the robot.
*/
@@ -54,7 +50,7 @@ public class SwerveDriveConfiguration
{
this.moduleCount = moduleConfigs.length;
this.imu = swerveIMU;
this.invertedIMU = invertedIMU;
swerveIMU.setInverted(invertedIMU);
this.modules = createModules(moduleConfigs, driveFeedforward);
this.moduleLocationsMeters = new Translation2d[moduleConfigs.length];
for (SwerveModule module : modules)
@@ -92,10 +88,11 @@ public class SwerveDriveConfiguration
Translation2d centerOfModules = moduleLocationsMeters[0];
//Calculate the Center by adding all module offsets together.
for(int i=1; i<moduleLocationsMeters.length; i++){
for (int i = 1; i < moduleLocationsMeters.length; i++)
{
centerOfModules = centerOfModules.plus(moduleLocationsMeters[i]);
}
}
//Return Largest Radius
return centerOfModules.getDistance(moduleLocationsMeters[0]);
}