V5 Holonomic/X-Drive Coding Help

Hello everyone, I’m trying to make this xdrive code work, and for some reason the bot is going all over the place and I think I may have set it up wrong, and I wanted to make sure that it is not a code issue,

Here is what I currently have:

FR.spin(forward, Controller1.Axis3.value() - Controller1.Axis1.value() - Controller1.Axis4.value(), percent);
RR.spin(forward, Controller1.Axis3.value() - Controller1.Axis1.value() + Controller1.Axis4.value(), percent);
FL.spin(forward, Controller1.Axis3.value() + Controller1.Axis1.value() + Controller1.Axis4.value(), percent);
RL.spin(forward, Controller1.Axis3.value() + Controller1.Axis1.value() - Controller1.Axis4.value(), percent);

Does anybody see if I made a mistake? For clarity, I’m trying to do left stick arcade drive with right stick (axis 1) for turning. Thanks in advance, and if this is something that was asked before, sorry for the new thread and please link it if possible s I can take a look.

Do you mean right stick for strafing? I usually use that for turning.

My bad, left stick axis 4 for strafing, right stick axis 1 for turning, I’ll edit my original post.

Your equations are incorrect for some of your wheels. The best way to figure it out, is to unplug all of your wheel ports except one and then see if that wheel works (your front left wheel looks correct). Repeat this process until you have the code the way you want it.

3 Likes

Awesome thanks!

(20 characters)