# XRP WPILIB Encoder Velocities always 0.0

**URL:** <https://xrp.discourse.group/t/xrp-wpilib-encoder-velocities-always-0-0/335>\
**Category:** Support\
**Created:** [May 1, 2024, 12:08am UTC](https://xrp.discourse.group/t/xrp-wpilib-encoder-velocities-always-0-0/335 "2024-05-01T00:08:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hknorr](https://avatars.discourse-cdn.com/v4/letter/h/eb9ed0/32.png) [@hknorr](https://xrp.discourse.group/u/hknorr)\
**Post date:** [May 1, 2024, 12:08am UTC](https://xrp.discourse.group/t/xrp-wpilib-encoder-velocities-always-0-0/335/1 "2024-05-01T00:08:18Z")

</div>

Using java and WPILIB to program the XRP, the encoders always report a velocity of 0.0 when using the encoder.getRate() method. Position is reporting correctly, so the encoders are working. Am I configuring something wrong or is the velocity reporting of the encoders not working properly?

---

<div class="post-metadata">

**Author:** ![Fgrossman](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Fgrossman](https://xrp.discourse.group/u/Fgrossman)\
**Post date:** [May 2, 2024, 2:14am UTC](https://xrp.discourse.group/t/xrp-wpilib-encoder-velocities-always-0-0/335/2 "2024-05-02T02:14:26Z")

</div>

@ZeeQueue can you give further information on this problem?

---

<div class="post-metadata">

**Author:** ![hknorr](https://avatars.discourse-cdn.com/v4/letter/h/eb9ed0/32.png) [@hknorr](https://xrp.discourse.group/u/hknorr)\
**Post date:** [May 2, 2024, 12:55pm UTC](https://xrp.discourse.group/t/xrp-wpilib-encoder-velocities-always-0-0/335/3 "2024-05-02T12:55:02Z")

</div>

Created the Example XRP Java bot in VSCode and was working on adding in SysId logging routines to try to characterize the XRP. After analyzing the collected data, voltages and position data were good and velocity data was always 0.0. I then added added System.out.println(m\_leftEncoder.getRate()); to the drivetrain’s periodic and it always printed 0.0. Also, looking at the encoder data in the simulation dashboard, rate is always 0.0.

Here’s a link to the Git repository with the code:

> **[GitHub - WTR6808/XRP: Code for testing Experiential Robot](https://github.com/WTR6808/XRP)**
>
> Code for testing Experiential Robot. Contribute to WTR6808/XRP development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![ZeeQueue](https://yyz1.discourse-cdn.com/flex011/user_avatar/xrp.discourse.group/zeequeue/32/35_2.png) [@ZeeQueue](https://xrp.discourse.group/u/ZeeQueue)\
**Post date:** [May 2, 2024, 1:02pm UTC](https://xrp.discourse.group/t/xrp-wpilib-encoder-velocities-always-0-0/335/4 "2024-05-02T13:02:54Z")

</div>

Ah yeah, we never reported the measured velocity from the XRP to WPILib, just the distance ([allwpilib/simulation/halsim\_xrp at main · wpilibsuite/allwpilib · GitHub](https://github.com/wpilibsuite/allwpilib/tree/main/simulation/halsim_xrp#encoder))

Submit an issue on that repo and I can take a look at it once I get a bit of free time.

---

<div class="post-metadata">

**Author:** ![hknorr](https://avatars.discourse-cdn.com/v4/letter/h/eb9ed0/32.png) [@hknorr](https://xrp.discourse.group/u/hknorr)\
**Post date:** [May 2, 2024, 2:23pm UTC](https://xrp.discourse.group/t/xrp-wpilib-encoder-velocities-always-0-0/335/5 "2024-05-02T14:23:03Z")

</div>

@ZeeQueue  
Issue #6576 submitted. Thank you!
