My team decided to use a Mecanum Drive for our robot for the first time, but the problem is that we don’t know how to program a Mecanum Drive. Is there any template or anything else that can help my team out with programming? We are using Vexcode V5 Python for our compiler. (The wheels are already on properly if you are asking).
Exactly how you set it up is down to personal preference, but let’s assume that Axis3 is forwards/backwards. Axis4 is strafe and Axis1 is rotate left and right (axis as they appear on the V5 controller)
I’ll leave you to work out the code, but the basics would be:
Front right motor = Axis3 - Axis1 - Axis4
Back right motor = Axis3 - Axis1 + Axis4
Front left motor = Axis3 + Axis1 + Axis4
Back left motor = Axis3 + Axis1 - Axis4