Add ability to get Rotation2d as Measurement<Angle> #6491
Labels
component: wpimath
Math library
type: feature
Brand new functionality, features, pages, workflows, endpoints, etc.
Is your feature request related to a problem? Please describe.
My team is trying to convert our code to use Measure as a way to combat usage of incorrect units being used. Rotation2d currently has a constructor that allows creation via
Measure<Angle>
but no way to get aMeasure<Angle>
back.allwpilib/wpimath/src/main/java/edu/wpi/first/math/geometry/Rotation2d.java
Lines 76 to 83 in 25ad6ea
Describe the solution you'd like
I suggest the following method be implemented within the Rotation2d class
Describe alternatives you've considered
A current alternative is to create a new Measure using
Units.Rotations.of(Rotation2d.getRadians())
but this is less clean thanRotation2d.getMeasure()
Additional context
None
The text was updated successfully, but these errors were encountered: