# Problems with XRP Encoders and Distance

**URL:** <https://xrp.discourse.group/t/problems-with-xrp-encoders-and-distance/971>\
**Category:** Coding\
**Created:** [October 3, 2026, 6:55pm UTC](https://xrp.discourse.group/t/problems-with-xrp-encoders-and-distance/971 "2026-10-03T18:55:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ILoveXRPs](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@ILoveXRPs](https://xrp.discourse.group/u/ILoveXRPs)\
**Post date:** [October 3, 2026, 6:55pm UTC](https://xrp.discourse.group/t/problems-with-xrp-encoders-and-distance/971/1 "2026-10-03T18:55:30Z")

</div>

Hi everyone! I was coding an XRP with WPILib 2027 alpha7 and everything works on the robot coding wise except for the encoders. I have put the encoders on the correct ports in the code (4 and 5 for left motor and 6 and 7 for right motor) and have updated the inputs in the code. However, when I log and print distance travelled by the encoder when the XRP is travelling forward on full throttle, the distance returned is 0.0 (used getDistance()). I used multiple different XRPs and the XRP WPILib template provided by WPILib, and it still doesn’t work. Could someone please help me diagnose the issue and provide potential solutions? Thanks!
