I was wondering how you could code an arcade drive with mecanum wheels? Basically, we want forward on both to be forward, left on both to strafe left, and then forward on left back on right to be turn right, and vice versa for all of these.
I was thinking that for left and right, and front and back, you could half the joystick values and then add them, and feed the subsequent number to the x and y inputs on the mecanums vi. However, I am stumped on the rotation. Any helpo would be greatly appreciated thank you!
I’m not familiar with the Holonomic VIs and don’t have Labview in front of me to check but if the rotation is on a 1 to -1 scale don’t you just want half of the difference between the two y axis values?
Adding will not work. To turn, you have to have one joystick going forward and the other going backward. Adding these would either completely cancel out or make the motors turn very slowly. How do I resolve this problem?
Pseudo-code for Tank drive for mecanum can be found here and here.
If you want to use the LabVIEW mecanum vi, then process your 2 joystick values to create Y, X, and rotation inputs for the vi:
Y = (Yleft + Yright)/2
X = (Xleft + Xright)/2
rotation = K*(Yright - Yleft)/2
Start with K=0 and make sure the fwd/reverse and strafe work. Then slowly increase K from 0 to +1 until you find the right gain sensitivity for the rotation.