diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 582c218..c4eca1b 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -245,13 +245,11 @@ public class RobotContainer { // IF the driver is holding the aim button, aim the robot towards the hub and shooter ready new Trigger(() -> getDeadbandedDriverController().getRightTriggerAxis() >= 0.5) - .onTrue(new InstantCommand( - () -> m_robotSwerveDrive.driveFacingPosition( + .whileTrue(new RunCommand(() -> m_robotSwerveDrive.driveFacingPosition( getDeadbandedDriverController().getLeft(), - FieldPositions.HUB_POSITION, - ShooterConstants.AIM_LEAD_TIME.get() - ), m_robotSwerveDrive) - // }, m_robotSwerveDrive) + FieldPositions.HUB_POSITION, + ShooterConstants.AIM_LEAD_TIME.get() + ), m_robotSwerveDrive) // () -> { // m_robotSwerveDrive.driveFacingVelocity( // getDeadbandedDriverController().getLeft(), diff --git a/src/main/java/frc4388/robot/constants/BuildConstants.java b/src/main/java/frc4388/robot/constants/BuildConstants.java index fc42833..e426645 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 = 155; - public static final String GIT_SHA = "af3646ff4378382f3bfcce6ab7828823bb76be21"; - public static final String GIT_DATE = "2026-03-12 18:06:12 MDT"; + public static final int GIT_REVISION = 156; + public static final String GIT_SHA = "0d98232f30a0663939bef0d21533e1603090c7cd"; + public static final String GIT_DATE = "2026-03-12 18:13:33 MDT"; public static final String GIT_BRANCH = "MiraOrg"; - public static final String BUILD_DATE = "2026-03-12 18:11:48 MDT"; - public static final long BUILD_UNIX_TIME = 1773360708923L; + public static final String BUILD_DATE = "2026-03-12 18:30:13 MDT"; + public static final long BUILD_UNIX_TIME = 1773361813662L; 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 825569e..75542fd 100644 --- a/src/main/java/frc4388/robot/subsystems/swerve/SimpleSwerveSim.java +++ b/src/main/java/frc4388/robot/subsystems/swerve/SimpleSwerveSim.java @@ -78,6 +78,19 @@ public class SimpleSwerveSim implements SwerveIO { return 0.0; } + + public synchronized void pointAtXY(double x, double y) { + Translation2d target = new Translation2d(x, y); + Translation2d toTarget = target.minus(pose.getTranslation()); + if (toTarget.getNorm() < 1e-9) return; + Rotation2d desired = toTarget.getAngle(); + pose = new Pose2d(pose.getTranslation(), desired); + lastPose = pose; + vx = 0.0; + vy = 0.0; + omega = 0.0; + } + @Override public synchronized void updateInputs(SwerveState state) { if (state == null) return;