We are running into some huge issues with our swerve drive (again). This time, after driving, 3/4 of our swerves pivots just start going crazy - no input from controller anymore, they just start to randomly pivot around. This weirdly only happens without controller input - as soon as we start driving with controller again, it works fine and stops randomly pivoting.
Sorry, I’m not with the robot anymore. But when the problem was happening the module setpoints stayed constant, but the encoders were reading rapidly changing values. We also forgot to mention in our post that the problem only occurs for the first time after boot after the swerve drive receives input other than zero. After that, it happens whenever there is no stick input.
I have also linked the correct repository, sorry about that, the one that was linked is from our old drive implementation.
I can send a video tomorrow if this isn’t enough information. Thanks so much for your help!
I’m not positive about the inversion states, but the robot was driving a few weeks ago using the same exact program and configuration. We even tried reverting to the commit where the robot worked properly. We are using CANSparkMax motors for turning, not falcons. Also, we tried reducing kp by a lot, and the problem persisted, just much slower so as far as I can tell it is not an overshoot problem.
Thank you so much for your help, we hadn’t realized that the electronics were changed when the drivetrain was redone. The two CANCoders that were acting up had switched CAN IDs, and all of the falcons were shifted by 90 degrees. By redoing all of the CAN IDs and inverts, our drivetrain is now working perfectly. Thank you again!