-
Notifications
You must be signed in to change notification settings - Fork 610
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. |
852a376
to
6046a8f
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
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.
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.
For getAngularVelocity()
and getAngularAcceleration()
, was the plan to return units or doubles?
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.
We can't do both with the same name, so I was planning on just using doubles.
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.