-
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] Remove unit suffixes from variable and function names #7529
base: 2027
Are you sure you want to change the base?
[wpimath] Remove unit suffixes from variable and function names #7529
Conversation
calcmogul
commented
Dec 9, 2024
- Move units into API docs instead because suffixes make user code verbose and hard to read
- Rename trackWidth to trackwidth
- Make ultrasonic classes use meters instead of a mix of m, cm, mm, ft, and inches
This PR modifies commands. Please open a corresponding PR in Python Commands and include a link to this PR. |
6046a8f
to
5326e0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love to see how much cleaner wpimath is now! However, I noticed that some overloads that use the Java units system got the units added to their doc comments. (e.g., new ChassisSpeeds(LinearVelocity, LinearVelocity, AngularVelocity)
, DifferentialDriveOdometry.resetPosition(Rotation2d, Distance, Distance, Pose2d)
, and many others). Are the doc comments necessary? Functions in C++, which all use the units system, don't include the units in the doc comments.
Also, just so we don't forget to include this in the change notes, this changes the DifferentialDriveKinematics schema.
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/FlywheelSim.java
Outdated
Show resolved
Hide resolved
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/LinearSystemSim.java
Outdated
Show resolved
Hide resolved
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SingleJointedArmSim.java
Outdated
Show resolved
Hide resolved
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SingleJointedArmSim.java
Outdated
Show resolved
Hide resolved
wpimath/src/main/java/edu/wpi/first/math/estimator/KalmanTypeFilter.java
Outdated
Show resolved
Hide resolved
wpimath/src/main/java/edu/wpi/first/math/kinematics/ChassisSpeeds.java
Outdated
Show resolved
Hide resolved
wpimath/src/main/java/edu/wpi/first/math/kinematics/DifferentialDriveKinematics.java
Outdated
Show resolved
Hide resolved
wpimath/src/main/java/edu/wpi/first/math/system/plant/DCMotor.java
Outdated
Show resolved
Hide resolved
wpimath/src/main/java/edu/wpi/first/math/trajectory/Trajectory.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The differential drive odometry and pose estimators still have changed @param
comments for units parameters.
313181f
to
6fc2306
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, for what it's worth. I'll just note that merging this would mean every time we merge main back into 2027, any changes to wpimath will need to fix the merge conflicts. (The changes should be fairly trivial, though)
6fc2306
to
b26396d
Compare
b26396d
to
6059f81
Compare
f9a42c8
to
0015370
Compare
0015370
to
77187ec
Compare
* Move units into API docs instead because suffixes make user code verbose and hard to read * Rename trackWidth to trackwidth * Make ultrasonic classes use meters instead of a mix of m, cm, mm, ft, and inches
77187ec
to
f44e36b
Compare