Fix error

This commit is contained in:
mimigamin
2026-03-12 18:35:44 -06:00
parent 0d98232f30
commit 2de8c60597
3 changed files with 22 additions and 11 deletions
@@ -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(),
@@ -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(){}
@@ -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;