-
Notifications
You must be signed in to change notification settings - Fork 613
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
[wpimath] Remove rotation2d value field #7490
[wpimath] Remove rotation2d value field #7490
Conversation
Other than mathematical rigor, what is the motivation for this change? Given the widespread usage of this class in both team and library (both vendor and otherwise) code, I'm pretty nervous about the idea of introducing a significant behavior change in December. |
There's a thread about it on Chief Delphi. Here's some links of the relevant context: https://www.chiefdelphi.com/t/possible-bugs-in-rotation2d-and-rotation3d-java/474140/2 Fundamentally, Rotation2d is not an Euler angle; it’s a 2D unit vector. Thus, no assumptions should be made about the Euler angle it returns later. Rotation3d already works like this, but Rotation2d special-cases it because 254’s version did it that way first. I’ve wanted to get rid of that behavior, but was told we couldn’t because it would break too much user code. In my opinion, if a user wants Euler angle behavior, they should just use an Euler angle (double or Angle) instead of Rotation2d. Jared from 254 replied that the behavior we implemented wasn't actually what theirs did. Rotation2d wrapping the angle was always their intention.
Unfortunately, we didn’t realize this was the design intent and baked that exception into the API contract of WPILib’s version. 2027 is our chance to fix that.
This PR is targeting the 2027 branch, not main. |
Thanks, I'll just be over here removing my foot from my mouth. No issues with making this change targeting '27. |
wpimath/src/main/java/edu/wpi/first/math/geometry/Rotation2d.java
Outdated
Show resolved
Hide resolved
It's not part of SO(2).
d57f421
to
6b1c11c
Compare
It's not part of SO(2).