Hello,
From looking at documentation for position closed loop for our grayhill optical encoder, I figured out how to obtain the position using the method getSelectedSensorPosition(); however, how do I utilize this value to get the motor to move to a certain position every time the robot needs to.
For example, like in autonomous, to get the robot to move to a certain distance using encoders.
I do have code of what I have so far on this github repo: https://github.com/FRC-4509-MechBulls/Grayhill-PID/blob/master/src/main/java/frc/robot/Robot.java