We’ve been having an issue with our swerve drive, where although the wheels can move the intended startup position when you power cycle, if you reinitialize to use the robot again without turning the robot off, the wheels will go out of position and will get worse with each reuse. They do move to the right position when the joystick position is set to move forward. I feel like I’m missing something important on how both the magnetic encoders and the resetToAbsolute function work. Does anyone have an idea of what might be happening? How do we resetToAbsolue function in the code and the bootToAbsolute function for the cancoders work?
For background, we are using Neo motors and the code from 3512 as a base. We are manually set our offsets by getting the cancoder reports form the dashboard and entering that in to the constants file.
Here’s a link to our code: GitHub - pcrobotics2/SwerveTestCode