From aac68dad5eabfaa1e098ad8cf6e42cd3bddd1ef3 Mon Sep 17 00:00:00 2001 From: mimigamin Date: Sat, 14 Mar 2026 20:20:55 -0600 Subject: [PATCH] Updates --- .../java/frc4388/robot/constants/BuildConstants.java | 10 +++++----- .../robot/subsystems/swerve/SimpleSwerveSim.java | 9 +-------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/main/java/frc4388/robot/constants/BuildConstants.java b/src/main/java/frc4388/robot/constants/BuildConstants.java index 16f7820..c2a2676 100644 --- a/src/main/java/frc4388/robot/constants/BuildConstants.java +++ b/src/main/java/frc4388/robot/constants/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "2026KPopRobotHunters"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 160; - public static final String GIT_SHA = "8c8ac261397954f1b5a118cb96d4e5f60d70da81"; - public static final String GIT_DATE = "2026-03-14 18:57:04 MDT"; + public static final int GIT_REVISION = 161; + public static final String GIT_SHA = "f5ecfd0be19548215558eee7217cf6eb1b8c487b"; + public static final String GIT_DATE = "2026-03-14 20:00:21 MDT"; public static final String GIT_BRANCH = "MiraOrg"; - public static final String BUILD_DATE = "2026-03-14 19:59:14 MDT"; - public static final long BUILD_UNIX_TIME = 1773539954157L; + public static final String BUILD_DATE = "2026-03-14 20:18:36 MDT"; + public static final long BUILD_UNIX_TIME = 1773541116232L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc4388/robot/subsystems/swerve/SimpleSwerveSim.java b/src/main/java/frc4388/robot/subsystems/swerve/SimpleSwerveSim.java index 3a177bb..44937da 100644 --- a/src/main/java/frc4388/robot/subsystems/swerve/SimpleSwerveSim.java +++ b/src/main/java/frc4388/robot/subsystems/swerve/SimpleSwerveSim.java @@ -27,25 +27,21 @@ public class SimpleSwerveSim implements SwerveIO { public synchronized void setControl(SwerveRequest ctrl) { if (ctrl == null) return; - // Handle FieldCentricFacingAngle — compute omega from target direction if (ctrl instanceof SwerveRequest.FieldCentricFacingAngle facingAngle) { vx = facingAngle.VelocityX; vy = facingAngle.VelocityY; - // Simple P controller to rotate toward target double currentAngle = pose.getRotation().getRadians(); double targetAngle = facingAngle.TargetDirection.getRadians(); double error = targetAngle - currentAngle; - // Wrap error to [-pi, pi] error = Math.atan2(Math.sin(error), Math.cos(error)); - double kP = 5.0; // tune this — matches PathPlanner's rotation PID + double kP = 5.0; omega = error * kP; return; } - // Handle FieldCentric (normal driving with explicit rotational rate) if (ctrl instanceof SwerveRequest.FieldCentric fc) { vx = fc.VelocityX; vy = fc.VelocityY; @@ -54,7 +50,6 @@ public class SimpleSwerveSim implements SwerveIO { } if (ctrl instanceof SwerveRequest.RobotCentric rc) { - // rotate velocity into field frame double cos = pose.getRotation().getCos(); double sin = pose.getRotation().getSin(); double vxRobot = rc.VelocityX; @@ -65,13 +60,11 @@ public class SimpleSwerveSim implements SwerveIO { return; } - // Handle brake if (ctrl instanceof SwerveRequest.SwerveDriveBrake) { vx = 0; vy = 0; omega = 0; return; } - // Fallback: your original reflection approach ChassisSpeeds cs = tryGetSpeedsField(ctrl); if (cs != null) { vx = cs.vxMetersPerSecond;