Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document axis conventions for Joystick.getDirection() #7611

Open
calcmogul opened this issue Dec 31, 2024 · 0 comments
Open

Document axis conventions for Joystick.getDirection() #7611

calcmogul opened this issue Dec 31, 2024 · 0 comments
Labels
component: wpilibc WPILib C++ component: wpilibj WPILib Java type: bug Something isn't working. type: docs Related to documentation and information.

Comments

@calcmogul
Copy link
Member

calcmogul commented Dec 31, 2024

It's currently unclear which axis the angle is measured from and in which direction the angle increases.

  /**
   * Get the direction of the vector formed by the joystick and its origin in radians.
   *
   * @return The direction of the vector in radians
   */
  public double getDirectionRadians() {
    return Math.atan2(getX(), -getY());
  }
@calcmogul calcmogul added component: wpilibj WPILib Java component: wpilibc WPILib C++ type: bug Something isn't working. labels Dec 31, 2024
@auscompgeek auscompgeek added the type: docs Related to documentation and information. label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpilibc WPILib C++ component: wpilibj WPILib Java type: bug Something isn't working. type: docs Related to documentation and information.
Projects
None yet
Development

No branches or pull requests

2 participants