Skip to content

Commit

Permalink
return to normal
Browse files Browse the repository at this point in the history
  • Loading branch information
JayK445 committed Oct 27, 2023
1 parent 5e9969f commit 384896b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public void execute() {
double rotY = rotationYSupplier.getAsDouble();
boolean isRobotRelative = isRobotRelativeSupplier.getAsBoolean();

double targetAngle = Util.vectorToAngle(-rotX, -rotY);
double targetAngle = Util.angleSnap(Util.vectorToAngle(-rotX, -rotY), angles);

// if stick magnitude is greater then rotate angle mag
if (Util.vectorMagnitude(rotX, rotY) > Drive.ROTATE_VECTOR_MAGNITUDE) {
angle = targetAngle;
angle = isRobotRelative ? Util.normalizeDegrees(targetAngle + initialAngle) : targetAngle;
}

drivebaseSubsystem.driveAngle(new Pair<>(x, y), angle);
Expand Down

0 comments on commit 384896b

Please sign in to comment.