Skip to content

Commit

Permalink
renamed y to x because it makes more sense
Browse files Browse the repository at this point in the history
out of scope for this branch but it needed to get fixed
  • Loading branch information
willitcode committed Mar 13, 2024
1 parent 9971e06 commit 4962e88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/commands/AimWithLimelight.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ public void execute() {
if (limelight.hasValidTarget()) {
hasSeenTarget = true;
double z = limelight.getTX() * steerStrength;
double yComponent =
double xComponent =
distanceFromTarget
- ((targetHeight - mountHeight) / Math.tan((mountAngle + limelight.getTY())));
double y = yComponent * (Math.PI / 180.0) * driveStrength;
double x = xComponent * (Math.PI / 180.0) * driveStrength;
if (z > speedLimit) {
z = speedLimit;
}
drive.driveRobot(new Translation2d(y * -1.0, 0.0), z, false);
drive.driveRobot(new Translation2d(x * -1.0, 0.0), z, false);
boolean isAngled = Math.abs(limelight.getTX()) < turnDoneThreshold;
boolean isDistanced =
Math.abs(
Expand Down

0 comments on commit 4962e88

Please sign in to comment.