Swerve off by 180 Degrees

We recently finished building our final robot after weeks of testing and practicing with our Alpha Bot. In order to assemble our competition robot, we had to take our MK4 Swerve modules off of our practice robot and put them on the final one. We replaced the missing modules on the practice bot with modules from last year and tuned all of our constants and offsets. With both robots, Alpha and Beta, we encountered a problem where the robot’s front was actually its back. You could say that the gyro is off by 180 degrees, but after some investigation, we found that wasn’t the problem. We use a Pigeon 2.0 on both robots and we made sure that they are on properly and calibrated correctly. We found that inverting our drive motors seems to set everything to normal but that messes up all of our Autons. It doesn’t seem to me like it’s a code problem but we have the same problem with 2 different robots running the same code and we only encountered this issue after swapping drive bases. We haven’t encountered a problem like this before and don’t quite know how to go about solving it. We use 364’s BaseFalconSwerve Template with Falcon 500s and CANCoders. Any help would be appreciated.

Don’t know if it’s a code problem but our GitHub is located here if anyone wants to check it out.

Un-invert your motors and add 180 to your module offsets. Had the same issue and this was the fix.

3 Likes