Swerve Drive encoders not synced

Our swerve modules encoders are not syncing up to the absolute encoders. I believe this is because the relative encoders are getting reset while the motors are spinning

We have SDS mk4i modules and using the stock code.

Does anyone know how to make it not reset the relative encoders or to force it to reset?

Can you share a link of your code? You will have a much higher likelihood of solving your issue.

Here is our current code:

I have never tried to use the SDS libraries, but it is my understanding they have not been maintained in a few years and it causes issues with the newer versions of WPILib and such.

I think the common recommendation is to either use the WPILib examples
allwpilib/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand at main · wpilibsuite/allwpilib (github.com)

Use 364 template.

Or try YAGSL

2 Likes