we tried using yagsl for the swerve code, and whenever we move to a direction the wheels dont get to the right position and instead are offseted by about ~25deg until i leave the joystick for a second (no power to the motors from the gamepad) and then they rotate to the right position, why that may be?
We were told it may be PID, but nothing seemed to fix it when modifying the PID gains
(in the image blue is desired red is measured)
Just a quick thought, are your encoder conversion factors set correctly? If I remember correctly, YAGSL will initially set the motor’s internal encoders to whatever the absolute encoder is reading. Then while driving, it uses the internal encoders and the conversion factors to drive. As soon as you stop putting input in, I believe it again sets the internal encoder value to the absolute encoder value. If your conversion factors are wrong, that would seem to explain this issue.
I am referring to the “conversionFactor” setting in the physicalProperties.json file in the YAGSL configuration, specifically the “angle” part of it.
I’m not 100% sure about this but it’s something that came to mind when I read this.