Hello everyone! I’m Ömer from Team 6431. This year, we’re implementing a swerve drive system for the first time, but we’re encountering some challenges with the coding aspect. When we command the modules to move straight in the XY plane, applying a theta (rotation) causes the drives at two corners to reverse direction. However, when we invert the drive motors to correct this, it messes up the translational movement. Has anyone experienced something similar or knows how to resolve this issue?
We’re using the following setup: MK4i modules, CANCoders for absolute positioning, SparkMax motor controllers, Neo motors, and a Pigeon 2.0 for gyroscopic data. Any guidance or suggestions would be greatly appreciated! Our code is here: GitHub - Omer-Tuna-Cavdar/SwerveL3-master
To me this sounds like the bevels on the gears on the 2 corners were zeroed with the beveled gear on a different side than the other 2 modules. Try adding pi to the 2 modules in the offsets.
Is your SwerveDriveKinematics object configured correctly (i.e. correct bot length and width)? My team had a similar issue and that was what caused it. Please do send a video if you have time.