I'm having issues with holonomic driving with our meccanum robot. Driving forwards and backwards on the y-axis is working, and so is turning left and right with the twist-axis, but moving left and right on the x-axis isn't working. I know that in order to drive sideways, the wheels on one side have to be spinning away from each other, while the wheels on the other side need to spin towards each other. The moving back and forth and turning left and right is working, but when I try strafing, both sets of wheels spin away from each other, which is not correct. Here is my drive code (java):
Code:
double x = -Math.pow(joy1.getRawAxis(0), 3);
double y = -Math.pow(joy1.getRawAxis(1), 3);
double rot = -Math.pow(joy2.getRawAxis(0), 3);
if(Math.abs(x)>=0.1 || Math.abs(y)>=0.1 || Math.abs(rot)>=0.1) {
mainDrive.mecanumDrive_Cartesian(x, rot, y, gyro.getAngle());
}
The -Math.pow(); statements are for sensitivity, while the if statement is for a threshold. "x" is the x-axis, "y" is the y-axis, and "rot" is rotation. joy1 and joy2 are joysticks. If this is a mechanical problem, how do I fix it? If it is a programming problem, how do I fix it?