My team decided to use mecanum wheels this year, which are currently being assembled, but are not yet on our test robot. Using the advice that has already been posted, our programming team made some code that we think is correct. It wasn’t quite as simple as converting xy to polar, we had to make our brains hurt with radian-degree conversions,and angles being shifted 90deg, but the code we have seems to work correctly. Since the wheels aren’t actually on the robot yet, we can’t see how it moves, but from what I’ve read about mecanum wheels, the motors are spinning in the correct directions based on the input from the joystick. My only concern is that often times the motors are not going at full speed:
Rotation(which we have on a separate joystick) works fine, pushing it all the way one direction sets -1 or 1 to each side based on which direction we’re tuning.
However, for all other situations, the motors are rarely at full power. I have a feeling this is the way the sin and cos functions in holomicdrive.vi inherently are going to work to make sure your speed is consistent in any direction, but I am still worried.
When we push the main joystick full forward, and give the holonomicdrive.vi the equivalent of 1 magnitude, 0 heading, and 0 rotation, the motors all go in the same direction but at about ~70% power. A similar thing happens when we strafe straight sideways, the motors are all going in the correct direction to cancel force vectors for sideways motion, but it is not at 100%.
The only other time any motor ever gets to 100% besides purely rotating, is when we push the joystick into one of its corners. In that case, two motors go to 100%.
We want to get as much power out of our drive system as possible, even if it means the robot will move slower in certain directions. Even just for full forward or backward, I would like to be able to set all the motors to 100% forward without any extra functions.
Is there anything we can do about this? Is this how mecanum wheels are supposed to work? I could always make a button that sets full power to all the wheels, but having it built into the regular control system would be better.