Closed TaylerUva closed 1 month ago
This is something we'll probably look at in the off-season - Units
and Measures
weren't available in WPILib early enough for us to evaluate implementing it for use this season.
We do want units to be easily manageable though, so this is a good candidate for potential integration over the summer.
Fixed in beta 1
WPILib provides a Units and Measures class. Phoenix classes should provide getters and setters for WPILib Measures allowing the conversions to be done in the back end.
For example TalonFX.setPosition is accepts a position in rotations as a double:
If it instead accepts a Measure a team could provide a value in degrees or radians the back end would automatically convert it to Rotations.
This would work great in combination with the existing
Feedback.SensorToMechanismRatio
as TalonFX.getPosition() could be returned in Unit.Rotations and be easily converted to degreesThe overall goal of this request is reduce the amount of unit conversion errors.