Teams should tune the SwerveDrivePoseEstimatorvisionStdDevif you’re using vision to help odometry. To tune vision it’s mostly guess and check on the standard deviation with a scale depending on distance. Some teams experience better stability by filtering out all estimated poses X distance away.
After that you can tune discretization to compensate for the system delay. More information on tuning discretization is here.
All of these are individual tuning steps which build on top of each other.
If you mess with a lower step all the higher steps will be out of sync, and if you need to replace a part like your gyro you may need to redo all of it anyways.
The math heavy explanation on tuning out drift is available here.