From e196df029f8ff1f5b960d6e76d4cd96cf7469af2 Mon Sep 17 00:00:00 2001 From: Shikhar Date: Sat, 28 Feb 2026 10:45:46 -0700 Subject: [PATCH] aim to hub pid fixes drift correction for aim to hub --- src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java | 1 + .../frc4388/robot/subsystems/swerve/SwerveDriveConstants.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java b/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java index a6c772e..460ca01 100644 --- a/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java +++ b/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java @@ -282,6 +282,7 @@ public class SwerveDrive extends SubsystemBase implements Queryable { leftStick = leftStick.rotateBy(TimesNegativeOne.ForwardOffset); leftStick = TimesNegativeOne.invert(leftStick, TimesNegativeOne.XAxis, TimesNegativeOne.YAxis); + rotTarget = heading.getDegrees(); var ctrl = new SwerveRequest.FieldCentricFacingAngle() .withVelocityX(leftStick.getX() * speedAdjust) diff --git a/src/main/java/frc4388/robot/subsystems/swerve/SwerveDriveConstants.java b/src/main/java/frc4388/robot/subsystems/swerve/SwerveDriveConstants.java index 16f617d..e295b7f 100644 --- a/src/main/java/frc4388/robot/subsystems/swerve/SwerveDriveConstants.java +++ b/src/main/java/frc4388/robot/subsystems/swerve/SwerveDriveConstants.java @@ -162,7 +162,7 @@ public final class SwerveDriveConstants { // TODO: Replace this with a static constant - public static final ConfigurableDouble AIM_kP = new ConfigurableDouble("Aim kP", 15); + public static final ConfigurableDouble AIM_kP = new ConfigurableDouble("Aim kP", 12); public static final ConfigurableDouble AIM_kI = new ConfigurableDouble("Aim kI", 0); public static final ConfigurableDouble AIM_kD = new ConfigurableDouble("Aim kD", 0.1); // public static final Gains AIM_GAINS = new Gains(2.5, 0, 0.1);