Skip to content

Commit

Permalink
get goal angle from joystick
Browse files Browse the repository at this point in the history
  • Loading branch information
liulinden committed Jan 18, 2024
1 parent 0b69a8c commit 850338b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ public void execute() {

double rightX = controller.getRightX();
double rightY = controller.getRightY();
double angleGoal= Math.atan(rightY/rightX);
if (rightX < 0) angleGoal+=Math.PI;
angleGoal %= (2*Math.PI);


}

/**
Expand Down

0 comments on commit 850338b

Please sign in to comment.