Swerve Drive Problems

so im using a new standart code for my swerve , my wiring is good , my id’s and offsets are good , when im driving it the robot drives good but when trying to rotate the 2 back wheels are working good and the 2 front one miss 90 from the rotating position , any ideas why is it caused?

Hi, could you please post a link to your code. Also could you please provide more information about your problem, code, and hardware.

could be a module position offsets are flipped for the two front modules

A problem my team faced, was this similar to this situation, and the reason why they weren’t rotating the correctly was because of the module locations not being setup correctly. To fix it you would need to switch the Translation2d measurements of the modules in your code that are not behaving correctly.

image

Sounds like the front modules might have the wrong offsets or the zero positions aren’t set correctly. Even if the offsets seem fine in code, I’d double-check them by physically aligning the wheels to their correct orientation (like all pointing forward) and re-calibrating. Sometimes the offsets can look good but still be off if something got flipped during setup. Also, make sure your code isn’t accidentally reversing the direction for those front modules during rotation. Could be a small bug in how the angles are calculated for turning.

it helped me with the turning now its good but my field relative drive doesnt work and all of my calculations are good

Could you describe the problem? Are you providing a robot angle with a gyroscope? Could you also link your code to take look?

i am using the limelight 3G and the pigeon 2.0 , my problem is when jnot moving mt robot jumprs in place cause of bad measurments

This is almost certainly the issue for the initial issue. And if you swapped the wrong modles around could make some weird things happen in field relative drive.

Would you be able to provide what the code is supposed to do? And would be very much appreciated to be linked to some code. :slight_smile:
Do you set your angle in a similar way?
We organize it as seen here:

image