having done mechanum last year i can tell you how to solve 50 percent of this problem, go to ace and get some Graphite Lubricant. use this on all of the mechanum rollers being very careful to not get it on the roller surface. this makes the rollers much more consistent in their rolling and makes it work a lot better. the second thing to to is check all of your bearings and make sure they are not binding. after that there is not much you can do. i dont think the programing is usualy at fault for not driving straight, but it is one place where programing can solve the mechanical error. PID might be a good thing, ramping code is also useful.
Curving while strafing sounds like you might have more weight on one end of the robot than the other. The wheels on the heavier end will usually tend to run a little slower than the wheels on the lighter end.
When using four separate gearboxes (I’m assuming you are for proper mecanum control), small differences in mechanical and electrical resistance have a much greater effect. I would use PID controllers with encoders on each gearbox to control their rate.
All the listed posts will address separate problems which will get you closer to optimum performance; however, one way to ensure you correct for ANY problem (even the ones you don’t know about) is to hook up a gyro, and have that autocorrect your orientation. We don’t have any experienced programmers, but got the gyro working. Do some searches for how to get that wired/coded.
Might depend on the weight. If your battery, compressor, cRIO, and power distribution are all on one end of the robot, I’d say you’d need to move one or more of them to the other end, if possible. If you’re already fairly balanced, but having an arm out causes you to curve, a gyro combined with PID might work.
Yes, that would be consistent with a problem with the rollers. The rollers don’t spin when you are driving straight forward. They spin a LOT when you are strafing.
To rule out the weight distribution as the cause of the problem, try adding some temporary weight to the lighter end of the vehicle and see if there is any improvement.