Updating odometry using SparkMAX and Neo

Hi!

We’ve been trying to use the update odometry function, however could not figure out how to get distanceLeftMeters and distanceRightMeters from the Rev Robotics relative encoder class you get from the SparkMax, as it does not have the getDistance() function that the FRC encoder class has.

You’ll use getPosition() from the encoder class to return that. It returns in rotations though, so make sure you set the position conversion factor or have some way of returning the correct unit.

1 Like