-
Notifications
You must be signed in to change notification settings - Fork 611
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] All non-deprecated SimpleMotorFeedforward calculate
methods require units
#7280
Comments
This is because I agree that this isn't a great situation; I think we should add a note to the documentation explaining the above. I'm also concerned about silent breakage for teams that use the double functions this year, since the code would still compile with the new implementation, but the behavior would be wildly different. |
At a minimum, it seems odd that |
Also, was there a reason that the new overloads weren't simply given a different name? It seems like that would have solved this issue without breaking parity between units and non-units. |
Because |
Sure, but that leaves us in the current situation where there is literally no way to use the class without units. Unless, again, the documented solution is to use deprecated methods. |
That's intentional for those methods. |
Why? My understanding is that the plan (before 2027 at least) is to not require that teams use units. Why does no other part of WPILib do the same thing? |
Because the Java feedforward functions in particular need types for disambiguation. C++ doesn't have this issue because they've always used units. |
Also, using a different name means it'll take 4+ years to get back to the better name with the deprecation/removal cycles being what they are. Command-based went through this and is still stuck in a wpilibj2 namespace because it's "breakage for the sake of breakage". |
That's fine, my point is just that there needs to be some documented solution for non-units. If that solution is using deprecated methods that's fine, in which case the Javadocs should clearly state that using the deprecated methods is intended in that situation. And again, |
Re: breaking changes, we won’t have our usual deprecation cycle going into 2027. There will be (many) things in 2026 that break in 2027. |
I haven't been closely following all of the changes to
SimpleMotorFeedforward
, but it seems like the current set ofcalculate
methods is a bit odd in Java. Here's are the current options:calculate(velocity, acceleration)
(non-units, deprecated)calculate(velocity)
(non-units, deprecated)calculate(velocity)
(units, non-deprecated)calculate(currentVelocity, nextVelocity)
(units, non-deprecated)I understand the move from accepting acceleration values to two velocity values, but it looks like the parity between units and non-units methods was lost. It seems like there should be a
calculate(currentVelocity, nextVelocity)
method that doesn't use units and thecalculate(velocity)
method should wrap that new method and be un-deprecated (the same way that the the units version ofcalculate(velocity)
wraps the units version ofcalculate(currentVelocity, nextVelocity)
).The text was updated successfully, but these errors were encountered: