setDistancePerPulse for pathfollowing with NEO motors

I am following this tutorial on pathfollowing with wpilib: Step 3: Creating a Drive Subsystem — FIRST Robotics Competition documentation

In the tutorial, it appears they are using external encoders while I am using the encoders built into the NEO motor from REVrobotics. In their tutorial, they use this method:

m_leftEncoder.setDistancePerPulse(DriveConstants.kEncoderDistancePerPulse);
m_rightEncoder.setDistancePerPulse(DriveConstants.kEncoderDistancePerPulse);

What is this and is there an equivalent for NEO motors with the REV library? Thanks!!

setPositionConversionFactor and setVelocityConversionFactor will provide equivalent functionality, although the numbers to pass to the function will be different.

Docs here:
https://codedocs.revrobotics.com/java/com/revrobotics/sparkmaxrelativeencoder#setPositionConversionFactor(double)

1 Like

so the conversion factor is the conversion from motor rotations to wheel rotations?

1 Like

The argument you pass is multiplied by the native unit (rotations for position, rpm for velocity) to get your converted unit.

Thanks!!