1) Using gear ratio, wheel radius, and encoder ticks per rotation, calculate inches per encoder tick
2) Gently push the robot a known distances, with a tape measure. Record the change in encoder ticks from the start-end. Use this to calculate inches per encoder tick.
Method two is better, because it takes into account things like wheel squish, slight inaccuracies in wheel radius, etc.
The value for inches / encoder tick can be set with the SparkMax or SparkMax Encoder methods, not sure which.
Currently the getRightEncoderPosition and left, convert rightEncoder.getPosition() from meters to inches, but if we calibrate it in inches, that is not needed. (Still needed for sim though)
Two methods:
1) Using gear ratio, wheel radius, and encoder ticks per rotation, calculate inches per encoder tick 2) Gently push the robot a known distances, with a tape measure. Record the change in encoder ticks from the start-end. Use this to calculate inches per encoder tick.
Method two is better, because it takes into account things like wheel squish, slight inaccuracies in wheel radius, etc.
The value for inches / encoder tick can be set with the SparkMax or SparkMax Encoder methods, not sure which.
Currently the
getRightEncoderPosition
and left, convertrightEncoder.getPosition()
from meters to inches, but if we calibrate it in inches, that is not needed. (Still needed for sim though)