You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you just want us to ctrl + f and go through each file to replace it, or to write a program that goes through all the files, searchs for Constants.inchToMetersConversionFactor and replace it with Units.inchesToMeters().
Also, do we happen to know which files to convert?
I think it is only in 2 files, so easiest to go by hand. FieldMap.java has most of the reference. I think subsystems/Vision.java has a couple. If you delete the variable and try to compile, it will be obvious.
The replacement will need a little care and handwork. Our variable is a multiplication constant, while the WPILib is a function call. Will end up with the same result, but it will be cleaner over time to use what WPILib provides.
Just to make sure it is clear, we have code like: x = 5.0 * Constants.inchToMetersConversionFactor;
and that will become: x = Units.inchesToMeters(5.0);
Of course, some of the code is a little more complicated.
WPILib supplies Units.inchesToMeters(), the reverse conversion, and a few others.
Get rid of Constants.inchToMetersConversionFactor and replace all uses to use the Units methods. Mostly this is FieldMap.
The text was updated successfully, but these errors were encountered: