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
@@ -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;