This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
XRP encoder direction bug? #4
fletch3555
started this conversation in
General Technical
Replies: 1 comment 1 reply
-
It looks like this was fixed yesterday on the firmware side: wpilibsuite/xrp-wpilib-firmware#29 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Has there been any hands-on testing with the new XRP bots? I have one and was attempting to run the example provided with beta-1, but running into issues.
WPILib version: 2024.1.1-beta-1
Language used: Java
Robot architecture: XRP - standard setup (2023 version sold by SparkFun)
It uses encoders built into the motors, but returned as separate DIO pins, so the example project constructs a separate Encoder object for each. When trying to use the provided
AutonomousDistance
auto mode command, it never ends. This seems to be because the left encoder counts down (negative while driving forward) while the right encoder counts up (positive while driving forward). Logically, I should invert the left encoder to resolve this, though it's counter-intuitive as I have the right motor set to inverted=true to support positive inputs (negated "up" inputs on an xbox controller). The only mechanism I've found to invert the encoder direction is theEncoder::reverseDirection()
method, which I can confirm in the simulation UI is changing the value, but doesn't actually change the raw count (get()
) or distance (getDistance()
) returned.As this point, I'm inclined to believe it's a bug in WPILib, though I'm not sure where exactly it would be. If there's any further testing I can do since I have one in-hand, please let me know. If you need a simple reproduction project to test with, I can put one together, though as I said before, this is effectively the example provided with virtually nothing changed (except things changed while testing).
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions