FtcRobotController icon indicating copy to clipboard operation
FtcRobotController copied to clipboard

Error in GoBildaPinpointDriver, setEncoderResolution method

Open jkenney2 opened this issue 3 months ago • 1 comments

The setEncoderResolution(double ticksPerUnit, DistanceUnit distanceUnit) method calculates the resolution (in ticks/mm) as follows:

resolution = distanceUnit.toMm(ticksPerUnit);

The problem is resolution is not a distance, it is ticks Per distance, so using the distanceUnit.toMm method directly on ticksPerUnit does not work as desired. This could be corrected as follows:

resolution = 1.0 / distanceUnit.toMm(1.0 / ticksPerUnit);

jkenney2 avatar Oct 07 '25 22:10 jkenney2

Thank you. I believe you are correct. I'll put the fix in for the next release of the SDK and let GoBilda know. In the meantime, I suggest you do the conversion yourself and pass in DistanceUnit.MM as the unit

alan412 avatar Oct 08 '25 23:10 alan412