As we are setting up our Mecanum drive in Java, we are encountering a problem: while we can get three of our motors to drive in the correct direction at any given time, at least one is off during either strafing or driving straight. For example, after inverting a couple motors, our strafing worked perfectly, but the drive was turning when it should have been going straight. However, it is not one particular motor - based on the direction our joystick is oriented, different motors are driving incorrectly. For example, the left rear motor may be going in the correct direction when we try to strafe with the other motors driving incorrectly, while the left front motor is the one driving incorrectly while we try to go straight.
We have tried many combinations of inverting motors and joystick axes, but can only figure out combinations that allow us to drive forward and back without strafing, or combinations that can strafe but turn while going forward and back. Any help, advice, or better resources to solve this problem would be appreciated.