From f3798cf2d4e46c792ba7abe51ed907ccf54637d8 Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Thu, 22 Jan 2026 19:59:52 -0500 Subject: [PATCH 01/13] Basic Swerve Impl --- gradle.properties | 2 +- lib/RoboLib | 2 +- src/main/java/frc/robot/RobotContainer.java | 24 ++++++++++++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index b6e0104..dd96912 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ frcYear = 2026 -wpiVersion = 2026.1.1 +wpiVersion = 2026.2.1 ctreVersion = 26.1.0 diff --git a/lib/RoboLib b/lib/RoboLib index 12bef1b..6f233e5 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit 12bef1b6a03a820e7a2d4f68e7f7375e040a9245 +Subproject commit 6f233e586fa8b5882c6346750677276c78c82ff7 diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a33249e..a83d1aa 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,13 +4,16 @@ package frc.robot; +import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveBuilder; +import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveDriveSubsystem; + +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.button.CommandXboxController; +import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.Constants.OperatorConstants; import frc.robot.commands.Autos; import frc.robot.commands.ExampleCommand; import frc.robot.subsystems.ExampleSubsystem; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.button.CommandXboxController; -import edu.wpi.first.wpilibj2.command.button.Trigger; /** * This class is where the bulk of the robot should be declared. Since Command-based is a @@ -26,10 +29,25 @@ public class RobotContainer { private final CommandXboxController m_driverController = new CommandXboxController(OperatorConstants.kDriverControllerPort); + public static SwerveDriveSubsystem driveSubsystem; + /** The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { // Configure the trigger bindings configureBindings(); + + SwerveBuilder swerveBuilder = new SwerveBuilder(); + + driveSubsystem = swerveBuilder + .withCanbusName("Drive") + .withPigeonId(2) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(1) + // There is a lot more in this object. But hopefully you get the point + .build() + ).build(); + } /** From 220f6b6488f82bdb25ebe7c982ebcf3c70d23b52 Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Sat, 24 Jan 2026 16:34:11 -0500 Subject: [PATCH 02/13] Not working... --- lib/RoboLib | 2 +- src/main/java/frc/robot/RobotContainer.java | 97 ++++++++++++++++++++- 2 files changed, 94 insertions(+), 5 deletions(-) diff --git a/lib/RoboLib b/lib/RoboLib index 6f233e5..604e9e7 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit 6f233e586fa8b5882c6346750677276c78c82ff7 +Subproject commit 604e9e7cc50187f8233916384f4a5c1640f0fdc9 diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a83d1aa..ad9c416 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -6,8 +6,11 @@ package frc.robot; import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveBuilder; import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveDriveSubsystem; +import org.littletonrobotics.junction.Logger; +import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.Constants.OperatorConstants; @@ -31,6 +34,14 @@ public class RobotContainer { public static SwerveDriveSubsystem driveSubsystem; + private double driveP = 0.5; + private double driveI = 0.0; + private double driveD = 0.0; + + private double steerP = 0.5; + private double steerI = 0.0; + private double steerD = 0.0; + /** The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { // Configure the trigger bindings @@ -40,13 +51,75 @@ public class RobotContainer { driveSubsystem = swerveBuilder .withCanbusName("Drive") - .withPigeonId(2) + .withPigeonId(20) .withSwerveModule( swerveBuilder.new SwerveModuleBuilder() - .withDriveMotorId(1) - // There is a lot more in this object. But hopefully you get the point + .withDriveMotorId(12) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withSteerMotorId(3) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerEncoderId(10) + .withModuleLocation(new Translation2d(-1, 1)) + .withModuleName("Front Left") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) .build() - ).build(); + ) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(5) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withSteerMotorId(6) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerEncoderId(4) + .withModuleLocation(new Translation2d(1, 1)) + .withModuleName("Front Right") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(9) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withSteerMotorId(11) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerEncoderId(4) + .withModuleLocation(new Translation2d(1, -1)) + .withModuleName("Back Right") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(8) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withSteerMotorId(2) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerEncoderId(7) + .withModuleLocation(new Translation2d(-1, -1)) + .withModuleName("Back Left") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) + .build(); + + driveSubsystem.setDefaultCommand(getDriveCommand()); } @@ -69,6 +142,22 @@ public class RobotContainer { m_driverController.b().whileTrue(m_exampleSubsystem.exampleMethodCommand()); } + public Command getDriveCommand(){ + return Commands.run(new Runnable() { + + @Override + public void run() { + driveSubsystem.setChassisSpeedsFromJoystick( + m_driverController.getLeftX() * Math.abs(m_driverController.getLeftX()), + m_driverController.getLeftY() * Math.abs(m_driverController.getLeftY()), + m_driverController.getRightX() * Math.abs(m_driverController.getRightX())); + + Logger.recordOutput("SwerveState", driveSubsystem.getModuleStates()); + } + + }, driveSubsystem); + } + /** * Use this to pass the autonomous command to the main {@link Robot} class. * From 09a94fa6de838243f8cd5a4006a4c395a1ac233c Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Mon, 26 Jan 2026 22:26:32 -0500 Subject: [PATCH 03/13] Hopeful fixes from the first round of tests --- lib/RoboLib | 2 +- simgui-ds.json | 97 +++++++++++++++++++++ src/main/java/frc/robot/Robot.java | 1 + src/main/java/frc/robot/RobotContainer.java | 65 ++++++++------ 4 files changed, 139 insertions(+), 26 deletions(-) create mode 100644 simgui-ds.json diff --git a/lib/RoboLib b/lib/RoboLib index 604e9e7..bc53ef3 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit 604e9e7cc50187f8233916384f4a5c1640f0fdc9 +Subproject commit bc53ef3b38fdbeee623ce0b188dbc7097b3cb405 diff --git a/simgui-ds.json b/simgui-ds.json new file mode 100644 index 0000000..e3a2a39 --- /dev/null +++ b/simgui-ds.json @@ -0,0 +1,97 @@ +{ + "keyboardJoysticks": [ + { + "axisConfig": [ + { + "decKey": 65, + "incKey": 68 + }, + { + "decKey": 87, + "incKey": 83 + }, + { + "decKey": 69, + "decayRate": 0.0, + "incKey": 82, + "keyRate": 0.009999999776482582 + } + ], + "axisCount": 3, + "buttonCount": 4, + "buttonKeys": [ + 90, + 88, + 67, + 86 + ], + "povConfig": [ + { + "key0": 328, + "key135": 323, + "key180": 322, + "key225": 321, + "key270": 324, + "key315": 327, + "key45": 329, + "key90": 326 + } + ], + "povCount": 1 + }, + { + "axisConfig": [ + { + "decKey": 74, + "incKey": 76 + }, + { + "decKey": 73, + "incKey": 75 + } + ], + "axisCount": 2, + "buttonCount": 4, + "buttonKeys": [ + 77, + 44, + 46, + 47 + ], + "povCount": 0 + }, + { + "axisConfig": [ + { + "decKey": 263, + "incKey": 262 + }, + { + "decKey": 265, + "incKey": 264 + } + ], + "axisCount": 2, + "buttonCount": 6, + "buttonKeys": [ + 260, + 268, + 266, + 261, + 269, + 267 + ], + "povCount": 0 + }, + { + "axisCount": 0, + "buttonCount": 0, + "povCount": 0 + } + ], + "robotJoysticks": [ + { + "guid": "030000004c050000cc09000011810000" + } + ] +} diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index ef794b3..3d506fd 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -50,6 +50,7 @@ public class Robot extends LoggedRobot { // String logPath = LogFileUtil.findReplayLog(); // Pull the replay log from AdvantageScope (or prompt the user) // Logger.setReplaySource(new WPILOGReader(logPath)); // Read replay log // Logger.addDataReceiver(new WPILOGWriter(LogFileUtil.addPathSuffix(logPath, "_sim"))); // Save outputs to a new log + Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables } // Logger.disableDeterministicTimestamps() // See "Deterministic Timestamps" in diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index ad9c416..1f49d55 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -6,11 +6,13 @@ package frc.robot; import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveBuilder; import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveDriveSubsystem; +import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveModule; import org.littletonrobotics.junction.Logger; import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.CommandPS4Controller; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.Constants.OperatorConstants; @@ -32,6 +34,8 @@ public class RobotContainer { private final CommandXboxController m_driverController = new CommandXboxController(OperatorConstants.kDriverControllerPort); + // private final CommandPS4Controller m_driverController = new CommandPS4Controller(OperatorConstants.kDriverControllerPort); + public static SwerveDriveSubsystem driveSubsystem; private double driveP = 0.5; @@ -52,6 +56,8 @@ public class RobotContainer { driveSubsystem = swerveBuilder .withCanbusName("Drive") .withPigeonId(20) + .withMaxLinearVelocity(3.0) + .withMaxAngularVelocity(Math.PI * 2) .withSwerveModule( swerveBuilder.new SwerveModuleBuilder() .withDriveMotorId(12) @@ -63,7 +69,7 @@ public class RobotContainer { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerEncoderId(10) - .withModuleLocation(new Translation2d(-1, 1)) + .withModuleLocation(new Translation2d(1, 1)) .withModuleName("Front Left") .withGearRatio(8.14) .withWheelDiameter(0.1016) @@ -80,11 +86,27 @@ public class RobotContainer { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerEncoderId(4) - .withModuleLocation(new Translation2d(1, 1)) + .withModuleLocation(new Translation2d(1, -1)) .withModuleName("Front Right") .withGearRatio(8.14) .withWheelDiameter(0.1016) .build()) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(8) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withSteerMotorId(2) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerEncoderId(7) + .withModuleLocation(new Translation2d(-1, 1)) + .withModuleName("Back Left") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) .withSwerveModule( swerveBuilder.new SwerveModuleBuilder() .withDriveMotorId(9) @@ -95,25 +117,9 @@ public class RobotContainer { .withSteerKP(steerP) .withSteerKI(steerI) .withSteerKD(steerD) - .withSteerEncoderId(4) - .withModuleLocation(new Translation2d(1, -1)) - .withModuleName("Back Right") - .withGearRatio(8.14) - .withWheelDiameter(0.1016) - .build()) - .withSwerveModule( - swerveBuilder.new SwerveModuleBuilder() - .withDriveMotorId(8) - .withDriveKP(driveP) - .withDriveKI(driveI) - .withDriveKD(driveD) - .withSteerMotorId(2) - .withSteerKP(steerP) - .withSteerKI(steerI) - .withSteerKD(steerD) - .withSteerEncoderId(7) + .withSteerEncoderId(4) // TODO: Duplicate ID .withModuleLocation(new Translation2d(-1, -1)) - .withModuleName("Back Left") + .withModuleName("Back Right") .withGearRatio(8.14) .withWheelDiameter(0.1016) .build()) @@ -139,7 +145,7 @@ public class RobotContainer { // Schedule `exampleMethodCommand` when the Xbox controller's B button is pressed, // cancelling on release. - m_driverController.b().whileTrue(m_exampleSubsystem.exampleMethodCommand()); + // m_driverController.b().whileTrue(m_exampleSubsystem.exampleMethodCommand()); } public Command getDriveCommand(){ @@ -147,12 +153,21 @@ public class RobotContainer { @Override public void run() { - driveSubsystem.setChassisSpeedsFromJoystick( - m_driverController.getLeftX() * Math.abs(m_driverController.getLeftX()), - m_driverController.getLeftY() * Math.abs(m_driverController.getLeftY()), - m_driverController.getRightX() * Math.abs(m_driverController.getRightX())); + driveSubsystem.setChassisSpeedsFromJoystickFieldRelative( + -(m_driverController.getLeftY() * Math.abs(m_driverController.getLeftY())), + -(m_driverController.getLeftX() * Math.abs(m_driverController.getLeftX())), + -(m_driverController.getRawAxis(3) * Math.abs(m_driverController.getRawAxis(3)))); Logger.recordOutput("SwerveState", driveSubsystem.getModuleStates()); + Logger.recordOutput("Pose Estimation", driveSubsystem.getRobotPose()); + + for(int i = 0;i Date: Tue, 27 Jan 2026 20:47:15 -0500 Subject: [PATCH 04/13] Working on swerve pid --- lib/RoboLib | 2 +- src/main/java/frc/robot/RobotContainer.java | 25 ++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/RoboLib b/lib/RoboLib index bc53ef3..ae74213 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit bc53ef3b38fdbeee623ce0b188dbc7097b3cb405 +Subproject commit ae742134fec8c62eb2e8816f844068d11c8f018f diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 1f49d55..12f8b32 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -10,6 +10,7 @@ import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveModule; import org.littletonrobotics.junction.Logger; import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.math.kinematics.ChassisSpeeds; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.CommandPS4Controller; @@ -38,13 +39,15 @@ public class RobotContainer { public static SwerveDriveSubsystem driveSubsystem; - private double driveP = 0.5; + private double driveP = 0.1; private double driveI = 0.0; - private double driveD = 0.0; + private double driveD = 0.01; + private double driveKV = 0.2; - private double steerP = 0.5; + private double steerP = 0.1; private double steerI = 0.0; private double steerD = 0.0; + private double steerKV = 0.1; /** The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { @@ -64,10 +67,12 @@ public class RobotContainer { .withDriveKP(driveP) .withDriveKI(driveI) .withDriveKD(driveD) + .withDriveKV(driveKV) .withSteerMotorId(3) .withSteerKP(steerP) .withSteerKI(steerI) .withSteerKD(steerD) + .withSteerKV(steerKV) .withSteerEncoderId(10) .withModuleLocation(new Translation2d(1, 1)) .withModuleName("Front Left") @@ -81,11 +86,13 @@ public class RobotContainer { .withDriveKP(driveP) .withDriveKI(driveI) .withDriveKD(driveD) + .withDriveKV(driveKV) .withSteerMotorId(6) .withSteerKP(steerP) .withSteerKI(steerI) .withSteerKD(steerD) - .withSteerEncoderId(4) + .withSteerKV(steerKV) + .withSteerEncoderId(1) .withModuleLocation(new Translation2d(1, -1)) .withModuleName("Front Right") .withGearRatio(8.14) @@ -97,10 +104,12 @@ public class RobotContainer { .withDriveKP(driveP) .withDriveKI(driveI) .withDriveKD(driveD) + .withDriveKV(driveKV) .withSteerMotorId(2) .withSteerKP(steerP) .withSteerKI(steerI) .withSteerKD(steerD) + .withSteerKV(steerKV) .withSteerEncoderId(7) .withModuleLocation(new Translation2d(-1, 1)) .withModuleName("Back Left") @@ -113,11 +122,13 @@ public class RobotContainer { .withDriveKP(driveP) .withDriveKI(driveI) .withDriveKD(driveD) + .withDriveKV(driveKV) .withSteerMotorId(11) .withSteerKP(steerP) .withSteerKI(steerI) .withSteerKD(steerD) - .withSteerEncoderId(4) // TODO: Duplicate ID + .withSteerKV(steerKV) + .withSteerEncoderId(4) .withModuleLocation(new Translation2d(-1, -1)) .withModuleName("Back Right") .withGearRatio(8.14) @@ -156,7 +167,9 @@ public class RobotContainer { driveSubsystem.setChassisSpeedsFromJoystickFieldRelative( -(m_driverController.getLeftY() * Math.abs(m_driverController.getLeftY())), -(m_driverController.getLeftX() * Math.abs(m_driverController.getLeftX())), - -(m_driverController.getRawAxis(3) * Math.abs(m_driverController.getRawAxis(3)))); + -(m_driverController.getRawAxis(4) * Math.abs(m_driverController.getRawAxis(4)))); + + // driveSubsystem.setChassisSpeed(new ChassisSpeeds(0, 0, 0)); Logger.recordOutput("SwerveState", driveSubsystem.getModuleStates()); Logger.recordOutput("Pose Estimation", driveSubsystem.getRobotPose()); From 4a252beb2b184eac1ee476cad15197b3a56ebd5b Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Tue, 27 Jan 2026 22:17:26 -0500 Subject: [PATCH 05/13] Hopeful fixes from the second round of testing --- lib/RoboLib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/RoboLib b/lib/RoboLib index ae74213..bb59c52 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit ae742134fec8c62eb2e8816f844068d11c8f018f +Subproject commit bb59c528b79864a79737b192cd058ad892d43307 From bf25b5b4c7447ef8aea776e4e27fd1f1a1b7149c Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Thu, 29 Jan 2026 20:54:04 -0500 Subject: [PATCH 06/13] Working but offsets are busted --- lib/RoboLib | 2 +- src/main/java/frc/robot/RobotContainer.java | 30 ++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/RoboLib b/lib/RoboLib index bb59c52..f9c7df6 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit bb59c528b79864a79737b192cd058ad892d43307 +Subproject commit f9c7df64baa94652ae0f8f154962aac47069d8f0 diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 12f8b32..d1a2d45 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -11,6 +11,7 @@ import org.littletonrobotics.junction.Logger; import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.math.kinematics.ChassisSpeeds; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.CommandPS4Controller; @@ -44,10 +45,10 @@ public class RobotContainer { private double driveD = 0.01; private double driveKV = 0.2; - private double steerP = 0.1; - private double steerI = 0.0; - private double steerD = 0.0; - private double steerKV = 0.1; + private double steerP = 50; + private double steerI = 1; + private double steerD = 1; + private double steerKV = 0; /** The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { @@ -73,6 +74,7 @@ public class RobotContainer { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) + .withSteerOffset(0.048828) .withSteerEncoderId(10) .withModuleLocation(new Translation2d(1, 1)) .withModuleName("Front Left") @@ -87,11 +89,13 @@ public class RobotContainer { .withDriveKI(driveI) .withDriveKD(driveD) .withDriveKV(driveKV) + .withDriveInverted() .withSteerMotorId(6) .withSteerKP(steerP) .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) + .withSteerOffset(0.244875) .withSteerEncoderId(1) .withModuleLocation(new Translation2d(1, -1)) .withModuleName("Front Right") @@ -110,6 +114,7 @@ public class RobotContainer { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) + .withSteerOffset(0.430176) .withSteerEncoderId(7) .withModuleLocation(new Translation2d(-1, 1)) .withModuleName("Back Left") @@ -123,11 +128,13 @@ public class RobotContainer { .withDriveKI(driveI) .withDriveKD(driveD) .withDriveKV(driveKV) + .withDriveInverted() .withSteerMotorId(11) .withSteerKP(steerP) .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) + .withSteerOffset(0.012695) .withSteerEncoderId(4) .withModuleLocation(new Translation2d(-1, -1)) .withModuleName("Back Right") @@ -164,23 +171,16 @@ public class RobotContainer { @Override public void run() { - driveSubsystem.setChassisSpeedsFromJoystickFieldRelative( + driveSubsystem.setChassisSpeedsFromJoystickRobotRelative( -(m_driverController.getLeftY() * Math.abs(m_driverController.getLeftY())), -(m_driverController.getLeftX() * Math.abs(m_driverController.getLeftX())), -(m_driverController.getRawAxis(4) * Math.abs(m_driverController.getRawAxis(4)))); - // driveSubsystem.setChassisSpeed(new ChassisSpeeds(0, 0, 0)); + // driveSubsystem.setChassisSpeed(new ChassisSpeeds(1, 0, 0)); - Logger.recordOutput("SwerveState", driveSubsystem.getModuleStates()); + Logger.recordOutput("RequestedSwerveState", driveSubsystem.getRequestedModuleStates()); + Logger.recordOutput("ActualSwerveState", driveSubsystem.getActualModuleStates()); Logger.recordOutput("Pose Estimation", driveSubsystem.getRobotPose()); - - for(int i = 0;i Date: Thu, 29 Jan 2026 21:46:29 -0500 Subject: [PATCH 07/13] organizational changes --- lib/RoboLib | 2 +- src/main/java/frc/robot/RobotContainer.java | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/RoboLib b/lib/RoboLib index f9c7df6..b269ce0 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit f9c7df64baa94652ae0f8f154962aac47069d8f0 +Subproject commit b269ce00bddf7b3435c254c4e7bf6a8b48067c60 diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index d1a2d45..720fbe9 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,17 +4,13 @@ package frc.robot; -import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveBuilder; -import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveDriveSubsystem; -import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveModule; +import org.fairportrobotics.frc.robolib.drivesystems.swerve.SwerveBuilder; +import org.fairportrobotics.frc.robolib.drivesystems.swerve.SwerveDriveSubsystem; import org.littletonrobotics.junction.Logger; import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.kinematics.ChassisSpeeds; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.CommandPS4Controller; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.Constants.OperatorConstants; From fb326a5465e61b65d8e00ed70ca3787ca20e85eb Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Thu, 29 Jan 2026 21:55:04 -0500 Subject: [PATCH 08/13] Fix warnings --- lib/RoboLib | 2 +- src/main/java/frc/robot/Robot.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/RoboLib b/lib/RoboLib index b269ce0..51cd3df 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit b269ce00bddf7b3435c254c4e7bf6a8b48067c60 +Subproject commit 51cd3df642ff9d8ab5d2220884d6234ab517b4dd diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 3d506fd..2f9e6c3 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -111,7 +111,7 @@ public class Robot extends LoggedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } From ea7d8045b2d49d08d30ba7d326b94f2194776b93 Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Thu, 29 Jan 2026 22:55:45 -0500 Subject: [PATCH 09/13] Version file in deploy folder --- .gitignore | 3 +++ build.gradle | 32 ++++++++++++++++++++++++++++++ src/main/java/frc/robot/Robot.java | 21 ++++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/.gitignore b/.gitignore index 9a9ca7b..0eaa4d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # This gitignore has been specially created by the WPILib team. # If you remove items from this file, intellisense might break. +### Version Files ### +src/main/deploy/versionfile.txt + ### C++ ### # Prerequisites *.d diff --git a/build.gradle b/build.gradle index 7640d58..9a4bb94 100644 --- a/build.gradle +++ b/build.gradle @@ -101,9 +101,41 @@ deployArtifact.jarTask = jar wpi.java.configureExecutableTasks(jar) wpi.java.configureTestTasks(test) +def saveCommitTask = tasks.register("saveCommit") { + println "Current Version: " + getCheckedOutGitCommitHash(); + + def deployFolder = "$projectDir/src/main/deploy/" + def commitFile = new FileWriter(deployFolder + "versionfile.txt"); + doLast { + commitFile.write(getCheckedOutGitCommitHash() + " - " + new Date().toString()); + commitFile.close(); + println "versionfile.txt written"; + } +} + +def getCheckedOutGitCommitHash() { + def gitFolder = "$projectDir/.git/" + def takeFromHash = 12 + /* + * '.git/HEAD' contains either + * in case of detached head: the currently checked out commit hash + * otherwise: a reference to a file containing the current commit hash + */ + def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD + def isCommit = head.length == 1 // e5a7c79edabbf7dd39888442df081b1c9d8e88fd + // def isRef = head.length > 1 // ref: refs/heads/master + + if(isCommit) return head[0].trim().take(takeFromHash) // e5a7c79edabb + + def refHead = new File(gitFolder + head[1].trim()) // .git/refs/heads/master + refHead.text.trim().take takeFromHash +} + // Configure string concat to always inline compile tasks.withType(JavaCompile) { options.compilerArgs.add '-XDstringConcat=inline' + dependsOn saveCommitTask } + apply from: 'libs.gradle' diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 2f9e6c3..9971fa1 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -4,6 +4,10 @@ package frc.robot; +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Scanner; + import org.fairportrobotics.frc.posty.PostyManager; import org.littletonrobotics.junction.LogFileUtil; import org.littletonrobotics.junction.LoggedRobot; @@ -12,6 +16,7 @@ import org.littletonrobotics.junction.networktables.NT4Publisher; import org.littletonrobotics.junction.wpilog.WPILOGReader; import org.littletonrobotics.junction.wpilog.WPILOGWriter; +import edu.wpi.first.wpilibj.Filesystem; import edu.wpi.first.wpilibj.PowerDistribution; import edu.wpi.first.wpilibj.PowerDistribution.ModuleType; import edu.wpi.first.wpilibj2.command.Command; @@ -31,6 +36,19 @@ public class Robot extends LoggedRobot { private RobotContainer m_robotContainer; + public static String getVersion() { + try { + Scanner scan = new Scanner(new File(Filesystem.getDeployDirectory().getAbsolutePath() + "/versionfile.txt")); + String ver = scan.nextLine(); + scan.close(); + + return ver; + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + return ""; + } + /** * This function is run when the robot is first started up and should be used * for any @@ -40,6 +58,7 @@ public class Robot extends LoggedRobot { public void robotInit() { Logger.recordMetadata("ProjectName", "MyProject"); // Set a metadata value + Logger.recordMetadata("Software Version", getVersion()); if (isReal()) { Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs") @@ -58,6 +77,8 @@ public class Robot extends LoggedRobot { Logger.start(); // Start logging! No more data receivers, replay sources, or metadata values may // be added. + Logger.recordOutput("Software Version", getVersion()); + // Instantiate our RobotContainer. This will perform all our button bindings, // and put our // autonomous chooser on the dashboard. From dddd9096a09a77ee0e31237b747087792b23fb07 Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Fri, 30 Jan 2026 20:05:45 -0500 Subject: [PATCH 10/13] Possible Fix for swerve drive --- lib/RoboLib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/RoboLib b/lib/RoboLib index 51cd3df..8defb59 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit 51cd3df642ff9d8ab5d2220884d6234ab517b4dd +Subproject commit 8defb590f40120ea22befb0e0880bcbb2636b502 From 568d3b0bf80a88ea27b4d1bc89098465a7f21d37 Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Fri, 30 Jan 2026 22:25:14 -0500 Subject: [PATCH 11/13] Reorganization --- lib/RoboLib | 2 +- src/main/java/frc/robot/RobotContainer.java | 129 +------------- .../frc/robot/subsystems/DriveSubsystem.java | 166 ++++++++++++++++++ 3 files changed, 169 insertions(+), 128 deletions(-) create mode 100644 src/main/java/frc/robot/subsystems/DriveSubsystem.java diff --git a/lib/RoboLib b/lib/RoboLib index 8defb59..8175159 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit 8defb590f40120ea22befb0e0880bcbb2636b502 +Subproject commit 817515901ca237b9f47e2001f7d65f9e38249eb1 diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 720fbe9..33a5d7e 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,18 +4,13 @@ package frc.robot; -import org.fairportrobotics.frc.robolib.drivesystems.swerve.SwerveBuilder; -import org.fairportrobotics.frc.robolib.drivesystems.swerve.SwerveDriveSubsystem; -import org.littletonrobotics.junction.Logger; - -import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.Constants.OperatorConstants; import frc.robot.commands.Autos; import frc.robot.commands.ExampleCommand; +import frc.robot.subsystems.DriveSubsystem; import frc.robot.subsystems.ExampleSubsystem; /** @@ -34,113 +29,13 @@ public class RobotContainer { // private final CommandPS4Controller m_driverController = new CommandPS4Controller(OperatorConstants.kDriverControllerPort); - public static SwerveDriveSubsystem driveSubsystem; - - private double driveP = 0.1; - private double driveI = 0.0; - private double driveD = 0.01; - private double driveKV = 0.2; - - private double steerP = 50; - private double steerI = 1; - private double steerD = 1; - private double steerKV = 0; + public final DriveSubsystem driveSubsystem = new DriveSubsystem(m_driverController); /** The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { // Configure the trigger bindings configureBindings(); - SwerveBuilder swerveBuilder = new SwerveBuilder(); - - driveSubsystem = swerveBuilder - .withCanbusName("Drive") - .withPigeonId(20) - .withMaxLinearVelocity(3.0) - .withMaxAngularVelocity(Math.PI * 2) - .withSwerveModule( - swerveBuilder.new SwerveModuleBuilder() - .withDriveMotorId(12) - .withDriveKP(driveP) - .withDriveKI(driveI) - .withDriveKD(driveD) - .withDriveKV(driveKV) - .withSteerMotorId(3) - .withSteerKP(steerP) - .withSteerKI(steerI) - .withSteerKD(steerD) - .withSteerKV(steerKV) - .withSteerOffset(0.048828) - .withSteerEncoderId(10) - .withModuleLocation(new Translation2d(1, 1)) - .withModuleName("Front Left") - .withGearRatio(8.14) - .withWheelDiameter(0.1016) - .build() - ) - .withSwerveModule( - swerveBuilder.new SwerveModuleBuilder() - .withDriveMotorId(5) - .withDriveKP(driveP) - .withDriveKI(driveI) - .withDriveKD(driveD) - .withDriveKV(driveKV) - .withDriveInverted() - .withSteerMotorId(6) - .withSteerKP(steerP) - .withSteerKI(steerI) - .withSteerKD(steerD) - .withSteerKV(steerKV) - .withSteerOffset(0.244875) - .withSteerEncoderId(1) - .withModuleLocation(new Translation2d(1, -1)) - .withModuleName("Front Right") - .withGearRatio(8.14) - .withWheelDiameter(0.1016) - .build()) - .withSwerveModule( - swerveBuilder.new SwerveModuleBuilder() - .withDriveMotorId(8) - .withDriveKP(driveP) - .withDriveKI(driveI) - .withDriveKD(driveD) - .withDriveKV(driveKV) - .withSteerMotorId(2) - .withSteerKP(steerP) - .withSteerKI(steerI) - .withSteerKD(steerD) - .withSteerKV(steerKV) - .withSteerOffset(0.430176) - .withSteerEncoderId(7) - .withModuleLocation(new Translation2d(-1, 1)) - .withModuleName("Back Left") - .withGearRatio(8.14) - .withWheelDiameter(0.1016) - .build()) - .withSwerveModule( - swerveBuilder.new SwerveModuleBuilder() - .withDriveMotorId(9) - .withDriveKP(driveP) - .withDriveKI(driveI) - .withDriveKD(driveD) - .withDriveKV(driveKV) - .withDriveInverted() - .withSteerMotorId(11) - .withSteerKP(steerP) - .withSteerKI(steerI) - .withSteerKD(steerD) - .withSteerKV(steerKV) - .withSteerOffset(0.012695) - .withSteerEncoderId(4) - .withModuleLocation(new Translation2d(-1, -1)) - .withModuleName("Back Right") - .withGearRatio(8.14) - .withWheelDiameter(0.1016) - .build()) - .build(); - - driveSubsystem.setDefaultCommand(getDriveCommand()); - } /** @@ -162,26 +57,6 @@ public class RobotContainer { // m_driverController.b().whileTrue(m_exampleSubsystem.exampleMethodCommand()); } - public Command getDriveCommand(){ - return Commands.run(new Runnable() { - - @Override - public void run() { - driveSubsystem.setChassisSpeedsFromJoystickRobotRelative( - -(m_driverController.getLeftY() * Math.abs(m_driverController.getLeftY())), - -(m_driverController.getLeftX() * Math.abs(m_driverController.getLeftX())), - -(m_driverController.getRawAxis(4) * Math.abs(m_driverController.getRawAxis(4)))); - - // driveSubsystem.setChassisSpeed(new ChassisSpeeds(1, 0, 0)); - - Logger.recordOutput("RequestedSwerveState", driveSubsystem.getRequestedModuleStates()); - Logger.recordOutput("ActualSwerveState", driveSubsystem.getActualModuleStates()); - Logger.recordOutput("Pose Estimation", driveSubsystem.getRobotPose()); - } - - }, driveSubsystem); - } - /** * Use this to pass the autonomous command to the main {@link Robot} class. * diff --git a/src/main/java/frc/robot/subsystems/DriveSubsystem.java b/src/main/java/frc/robot/subsystems/DriveSubsystem.java new file mode 100644 index 0000000..e02055a --- /dev/null +++ b/src/main/java/frc/robot/subsystems/DriveSubsystem.java @@ -0,0 +1,166 @@ +package frc.robot.subsystems; + +import org.fairportrobotics.frc.posty.TestableSubsystem; +import org.fairportrobotics.frc.posty.test.PostTest; +import static org.fairportrobotics.frc.posty.assertions.Assertions.*; +import org.fairportrobotics.frc.robolib.drivesystems.swerve.SwerveBuilder; +import org.fairportrobotics.frc.robolib.drivesystems.swerve.SwerveDriveSystem; +import org.fairportrobotics.frc.robolib.drivesystems.swerve.SwerveModule; +import org.littletonrobotics.junction.Logger; + +import com.fasterxml.jackson.annotation.JsonCreator.Mode; + +import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.CommandXboxController; + +public class DriveSubsystem extends TestableSubsystem { + + private SwerveBuilder swerveBuilder = new SwerveBuilder(); + private SwerveDriveSystem driveSystem; + + private double driveP = 0.1; + private double driveI = 0.0; + private double driveD = 0.01; + private double driveKV = 0.2; + + private double steerP = 50; + private double steerI = 1; + private double steerD = 1; + private double steerKV = 0; + + public DriveSubsystem(CommandXboxController xboxController) { + + driveSystem = swerveBuilder + .withCanbusName("Drive") + .withPigeonId(20) + .withMaxLinearVelocity(3.0) + .withMaxAngularVelocity(Math.PI * 2) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(12) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withDriveKV(driveKV) + .withSteerMotorId(3) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerKV(steerKV) + .withSteerOffset(0.048828) + .withSteerEncoderId(10) + .withModuleLocation(new Translation2d(1, 1)) + .withModuleName("Front Left") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(5) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withDriveKV(driveKV) + .withDriveInverted() + .withSteerMotorId(6) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerKV(steerKV) + .withSteerOffset(0.244875) + .withSteerEncoderId(1) + .withModuleLocation(new Translation2d(1, -1)) + .withModuleName("Front Right") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(8) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withDriveKV(driveKV) + .withSteerMotorId(2) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerKV(steerKV) + .withSteerOffset(0.430176) + .withSteerEncoderId(7) + .withModuleLocation(new Translation2d(-1, 1)) + .withModuleName("Back Left") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) + .withSwerveModule( + swerveBuilder.new SwerveModuleBuilder() + .withDriveMotorId(9) + .withDriveKP(driveP) + .withDriveKI(driveI) + .withDriveKD(driveD) + .withDriveKV(driveKV) + .withDriveInverted() + .withSteerMotorId(11) + .withSteerKP(steerP) + .withSteerKI(steerI) + .withSteerKD(steerD) + .withSteerKV(steerKV) + .withSteerOffset(0.012695) + .withSteerEncoderId(4) + .withModuleLocation(new Translation2d(-1, -1)) + .withModuleName("Back Right") + .withGearRatio(8.14) + .withWheelDiameter(0.1016) + .build()) + .build(); + + this.setDefaultCommand(Commands.run(new Runnable() { + + @Override + public void run() { + driveSystem.setChassisSpeedsFromJoystickRobotRelative( + -(xboxController.getLeftY() * Math.abs(xboxController.getLeftY())), + -(xboxController.getLeftX() * Math.abs(xboxController.getLeftX())), + -(xboxController.getRawAxis(4) * Math.abs(xboxController.getRawAxis(4)))); + + // driveSubsystem.setChassisSpeed(new ChassisSpeeds(1, 0, 0)); + + Logger.recordOutput("RequestedSwerveState", driveSystem.getRequestedModuleStates()); + Logger.recordOutput("ActualSwerveState", driveSystem.getActualModuleStates()); + Logger.recordOutput("Pose Estimation", driveSystem.getRobotPose()); + } + + }, this)); + + } + + @Override + public void periodic() { + super.periodic(); + driveSystem.periodic(); + } + + @Override + public void simulationPeriodic() { + super.simulationPeriodic(); + driveSystem.simulationPeriodic(); + } + + @PostTest() + public void DriveSubsystem_CanDevicesConnected(){ + + SwerveModule[] modules = driveSystem.getModules(); + + for(int i=0;i < modules.length; i++){ + assertThat(modules[i].getDriveMotor().isConnected()).as(modules[i].getModuleName() + " drive motor is not connected").isTrue(); + assertThat(modules[i].getSteerMotor().isConnected()).as(modules[i].getModuleName() + " steer motor is not connected").isTrue(); + assertThat(modules[i].getSteerEncoder().isConnected()).as(modules[i].getModuleName() + " CANCoder is not connected").isTrue(); + } + + assertThat(driveSystem.getGyro().isConnected()).as("Pigeon is not connected").isTrue(); + + } + +} From 319e85b39b0160cda7c0fb6ba2b76ed9522c50fa Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Sat, 31 Jan 2026 14:03:47 -0500 Subject: [PATCH 12/13] It's working --- lib/RoboLib | 2 +- src/main/java/frc/robot/Robot.java | 2 -- .../java/frc/robot/subsystems/DriveSubsystem.java | 14 +++++++------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/RoboLib b/lib/RoboLib index 8175159..61fcb90 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit 817515901ca237b9f47e2001f7d65f9e38249eb1 +Subproject commit 61fcb90730f6f65a8340388702e2b6ce51944da3 diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 9971fa1..11ed78d 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -9,11 +9,9 @@ import java.io.FileNotFoundException; import java.util.Scanner; import org.fairportrobotics.frc.posty.PostyManager; -import org.littletonrobotics.junction.LogFileUtil; import org.littletonrobotics.junction.LoggedRobot; import org.littletonrobotics.junction.Logger; import org.littletonrobotics.junction.networktables.NT4Publisher; -import org.littletonrobotics.junction.wpilog.WPILOGReader; import org.littletonrobotics.junction.wpilog.WPILOGWriter; import edu.wpi.first.wpilibj.Filesystem; diff --git a/src/main/java/frc/robot/subsystems/DriveSubsystem.java b/src/main/java/frc/robot/subsystems/DriveSubsystem.java index e02055a..999ad9c 100644 --- a/src/main/java/frc/robot/subsystems/DriveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/DriveSubsystem.java @@ -24,9 +24,9 @@ public class DriveSubsystem extends TestableSubsystem { private double driveD = 0.01; private double driveKV = 0.2; - private double steerP = 50; - private double steerI = 1; - private double steerD = 1; + private double steerP = 20; + private double steerI = 0; + private double steerD = 0.0; private double steerKV = 0; public DriveSubsystem(CommandXboxController xboxController) { @@ -48,7 +48,7 @@ public class DriveSubsystem extends TestableSubsystem { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) - .withSteerOffset(0.048828) + .withSteerOffset(0.359375) .withSteerEncoderId(10) .withModuleLocation(new Translation2d(1, 1)) .withModuleName("Front Left") @@ -68,7 +68,7 @@ public class DriveSubsystem extends TestableSubsystem { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) - .withSteerOffset(0.244875) + .withSteerOffset(0.406494) .withSteerEncoderId(1) .withModuleLocation(new Translation2d(1, -1)) .withModuleName("Front Right") @@ -87,7 +87,7 @@ public class DriveSubsystem extends TestableSubsystem { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) - .withSteerOffset(0.430176) + .withSteerOffset(0.211670) .withSteerEncoderId(7) .withModuleLocation(new Translation2d(-1, 1)) .withModuleName("Back Left") @@ -107,7 +107,7 @@ public class DriveSubsystem extends TestableSubsystem { .withSteerKI(steerI) .withSteerKD(steerD) .withSteerKV(steerKV) - .withSteerOffset(0.012695) + .withSteerOffset(-0.235107) .withSteerEncoderId(4) .withModuleLocation(new Translation2d(-1, -1)) .withModuleName("Back Right") From 6725d63ffc583994613505c4b8ba3cae6394bdb3 Mon Sep 17 00:00:00 2001 From: Tyler Wilcox Date: Sun, 1 Feb 2026 17:43:56 -0500 Subject: [PATCH 13/13] PIN RoboLib --- lib/RoboLib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/RoboLib b/lib/RoboLib index 61fcb90..f90e2ac 160000 --- a/lib/RoboLib +++ b/lib/RoboLib @@ -1 +1 @@ -Subproject commit 61fcb90730f6f65a8340388702e2b6ce51944da3 +Subproject commit f90e2ac04d38a2dd1bd1dee233d691036d9d2bb3