How would I apply a conversion factor to my REV ThroughBore encoder? I was using the .getDistance method earlier but it gave inconcsistent readings after doing some browsing online I saw that it’s better to use .getAbsolutePosition().
shooterTiltThruBoreEncoder.setPositionOffset(0.659);
shooterTiltThruBoreEncoder.setDistancePerRotation(-360);
This is what I was doing before, and I accessed the distance with the .getDistance method, which gave different readings even if the shooter pivot never moved between power cycles.
My question is, how do I apply the offset and position conversion factors to scale my absolute position.
The offset is 0.659 rotations so that when our mechansim (a shooter on a pivot) is parallel to the horizontal. I want to convert to degrees. This is what I’m doing rn but it only worked with the .getDistance() method, I want to make a new method to apply these conversions to my absolute position. Any ideas?
public double getAbsoluteShooterTiltPos() {
return (shooterTiltThruBoreEncoder.getAbsolutePosition()-0.659)*360;
}
Is it as easy as doing this?