mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated to 2024.4.6.1
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user