-
Notifications
You must be signed in to change notification settings - Fork 665
[wpimath] Add interpolators for measures #8178
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
base: 2027
Are you sure you want to change the base?
Conversation
wpimath/src/test/java/edu/wpi/first/math/interpolation/InterpolatingMeasuresTreeMapTest.java
Outdated
Show resolved
Hide resolved
wpimath/src/test/java/edu/wpi/first/math/interpolation/InterpolatingMeasuresTreeMapTest.java
Outdated
Show resolved
Hide resolved
table.put(Units.Inches.of(Units.Meters.of(125.0).in(Units.Inches)), Units.Meters.of(450.0)); | ||
table.put(Units.Meters.of(200.0), Units.Feet.of(Units.Meters.of(510.0).in(Units.Feet))); | ||
table.put( | ||
Units.Centimeters.of(Units.Meters.of(268.0).in(Units.Centimeters)), | ||
Units.Meters.of(525.0)); | ||
table.put( | ||
Units.Inches.of(Units.Meters.of(312.0).in(Units.Inches)), | ||
Units.Feet.of(Units.Meters.of(550.0).in(Units.Feet))); | ||
table.put(Units.Meters.of(326.0), Units.Meters.of(650.0)); |
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.
Why doesn't this just use Units.Meters.of()
?
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.
to confirm it works properly if it is constructed with different units
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.
This doesn't feel like a super clear way to do that, but I guess it works. Maybe just add a comment to explain it?
Signed-off-by: Zach Harel <[email protected]>
…eInterpolator Signed-off-by: Zach Harel <[email protected]>
Signed-off-by: Zach Harel <[email protected]>
Signed-off-by: Zach Harel <[email protected]>
…eInterpolator Signed-off-by: Zach Harel <[email protected]>
…eeMapTest (and then delete InterpolatingMeasuresTreeMapTest) Signed-off-by: Zach Harel <[email protected]>
… of star import for consistency Signed-off-by: Zach Harel <[email protected]>
Signed-off-by: Zach Harel <[email protected]>
…ods in Interpolator and InverseInterpolator Signed-off-by: Zach Harel <[email protected]>
…Util and update tests accordingly Signed-off-by: Zach Harel <[email protected]>
6c2e4f1
to
634edc8
Compare
Signed-off-by: Zach Harel <[email protected]>
…e in interpolation methods in MathUtil Signed-off-by: Zach Harel <[email protected]>
this is also trivial to implement but for situations where we want to be unit-safe it would be nice to not have to define an interpolator and inverse interpolator every time we want an interpolator map with a measure