Merge pull request #3 from FairportRobotics/swervetuning

Correctly tuned swerves
This commit is contained in:
Tyler Wilcox 2026-03-02 18:52:51 -05:00 committed by GitHub
commit 1e19354a9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 16 deletions

View File

@ -33,7 +33,7 @@ public class DriveSubsystem extends TestableSubsystem {
driveSystem = swerveBuilder driveSystem = swerveBuilder
.withCanbusName("Drive") .withCanbusName("Drive")
.withPigeonId(20) .withPigeonId(1)
.withMaxLinearVelocity(3.0) .withMaxLinearVelocity(3.0)
.withMaxAngularVelocity(Math.PI * 2) .withMaxAngularVelocity(Math.PI * 2)
.withSwerveModule( .withSwerveModule(
@ -43,13 +43,13 @@ public class DriveSubsystem extends TestableSubsystem {
.withDriveKI(driveI) .withDriveKI(driveI)
.withDriveKD(driveD) .withDriveKD(driveD)
.withDriveKV(driveKV) .withDriveKV(driveKV)
.withSteerMotorId(3) .withSteerMotorId(11)
.withSteerKP(steerP) .withSteerKP(steerP)
.withSteerKI(steerI) .withSteerKI(steerI)
.withSteerKD(steerD) .withSteerKD(steerD)
.withSteerKV(steerKV) .withSteerKV(steerKV)
.withSteerOffset(0.359375) .withSteerOffset(-0.336426)
.withSteerEncoderId(10) .withSteerEncoderId(13)
.withModuleLocation(new Translation2d(1, 1)) .withModuleLocation(new Translation2d(1, 1))
.withModuleName("Front Left") .withModuleName("Front Left")
.withGearRatio(8.14) .withGearRatio(8.14)
@ -57,19 +57,19 @@ public class DriveSubsystem extends TestableSubsystem {
.build()) .build())
.withSwerveModule( .withSwerveModule(
swerveBuilder.new SwerveModuleBuilder() swerveBuilder.new SwerveModuleBuilder()
.withDriveMotorId(5) .withDriveMotorId(22)
.withDriveKP(driveP) .withDriveKP(driveP)
.withDriveKI(driveI) .withDriveKI(driveI)
.withDriveKD(driveD) .withDriveKD(driveD)
.withDriveKV(driveKV) .withDriveKV(driveKV)
.withDriveInverted() .withDriveInverted()
.withSteerMotorId(6) .withSteerMotorId(21)
.withSteerKP(steerP) .withSteerKP(steerP)
.withSteerKI(steerI) .withSteerKI(steerI)
.withSteerKD(steerD) .withSteerKD(steerD)
.withSteerKV(steerKV) .withSteerKV(steerKV)
.withSteerOffset(0.406494) .withSteerOffset(0.108887)
.withSteerEncoderId(1) .withSteerEncoderId(23)
.withModuleLocation(new Translation2d(1, -1)) .withModuleLocation(new Translation2d(1, -1))
.withModuleName("Front Right") .withModuleName("Front Right")
.withGearRatio(8.14) .withGearRatio(8.14)
@ -77,18 +77,18 @@ public class DriveSubsystem extends TestableSubsystem {
.build()) .build())
.withSwerveModule( .withSwerveModule(
swerveBuilder.new SwerveModuleBuilder() swerveBuilder.new SwerveModuleBuilder()
.withDriveMotorId(8) .withDriveMotorId(32)
.withDriveKP(driveP) .withDriveKP(driveP)
.withDriveKI(driveI) .withDriveKI(driveI)
.withDriveKD(driveD) .withDriveKD(driveD)
.withDriveKV(driveKV) .withDriveKV(driveKV)
.withSteerMotorId(2) .withSteerMotorId(31)
.withSteerKP(steerP) .withSteerKP(steerP)
.withSteerKI(steerI) .withSteerKI(steerI)
.withSteerKD(steerD) .withSteerKD(steerD)
.withSteerKV(steerKV) .withSteerKV(steerKV)
.withSteerOffset(0.211670) .withSteerOffset(-0.492432)
.withSteerEncoderId(7) .withSteerEncoderId(33)
.withModuleLocation(new Translation2d(-1, 1)) .withModuleLocation(new Translation2d(-1, 1))
.withModuleName("Back Left") .withModuleName("Back Left")
.withGearRatio(8.14) .withGearRatio(8.14)
@ -96,19 +96,19 @@ public class DriveSubsystem extends TestableSubsystem {
.build()) .build())
.withSwerveModule( .withSwerveModule(
swerveBuilder.new SwerveModuleBuilder() swerveBuilder.new SwerveModuleBuilder()
.withDriveMotorId(9) .withDriveMotorId(42)
.withDriveKP(driveP) .withDriveKP(driveP)
.withDriveKI(driveI) .withDriveKI(driveI)
.withDriveKD(driveD) .withDriveKD(driveD)
.withDriveKV(driveKV) .withDriveKV(driveKV)
.withDriveInverted() .withDriveInverted()
.withSteerMotorId(11) .withSteerMotorId(41)
.withSteerKP(steerP) .withSteerKP(steerP)
.withSteerKI(steerI) .withSteerKI(steerI)
.withSteerKD(steerD) .withSteerKD(steerD)
.withSteerKV(steerKV) .withSteerKV(steerKV)
.withSteerOffset(-0.235107) .withSteerOffset(0.470215)
.withSteerEncoderId(4) .withSteerEncoderId(43)
.withModuleLocation(new Translation2d(-1, -1)) .withModuleLocation(new Translation2d(-1, -1))
.withModuleName("Back Right") .withModuleName("Back Right")
.withGearRatio(8.14) .withGearRatio(8.14)