X-Drive Controller Set Up

So, as my team is planning on using an x-drive this year, we have a couple questions.

First, we are really struggling on how we should set up the remote to most easily control the movements. The x-drive is obviously a little more complicated to drive as it has less restrictions of movement. Should the turning and strafing be handled on several buttons, just the joysticks, or is it easier to do a dual-controller setup?

Secondly, how do you even BEGIN coding one of these things? I myself am not a programmer, but our team has never done this before. Explanations would be best if shown and explained in c++.




This is very helpful! however the videos are private.

1 Like

I believe the code is the same as a mecanum drive.
It’s really just a bunch of simple math. It looks daunting at first, but when you logically break it down, it becomes super simple.
I advise you try it out yourself before looking up videos.
Hint: the key to the code is getting the inputs of the two joysticks to work together


I would suggest having forward, backward, and strafing on one stick and on the other turning. But if you are used to tank controls, there is another (fairly simple) way to do that. I would also suggest not to use any buttons for strafing,
because imo that just gives you less room for other motors on the controller. If you are in dire need of help I can definitely help you out, but like @Railgunawesome said, try it out yourself first.


I prefer to have forward, backward, and turning on one stick and strafing assigned to the other

1 Like

It is very much like the X-Drive just slightly modified.

heres my code (Its a work in progress)

BackLeft.spin(directionType::fwd,Controller1.Axis3.value()-Controller1.Axis4.value()+Controller1.Axis1.value() , velocityUnits::pct);

    FrontLeft.spin(directionType::fwd,Controller1.Axis3.value()+Controller1.Axis4.value()+Controller1.Axis1.value() , velocityUnits::pct);

    BackRight.spin(directionType::rev,Controller1.Axis3.value()+Controller1.Axis4.value()-Controller1.Axis1.value() , velocityUnits::pct);

    FrontRight.spin(directionType::rev,Controller1.Axis3.value()-Controller1.Axis4.value()-Controller1.Axis1.value() , velocityUnits::pct);

This looks very similar to what I used for my mecanums last season (the code is basically the same as an X-Drive). A suggestion that could possibly make this code look cleaner is to assign each joystick input to a variable (ex: driveInput, turnInput, strafeInput)

but mecs can’t strafe vertically right? also, whould you say that mecs are better than x-drives? if so, I may have to look into getting some as a space-saving thing as well as structural design.

  • Mecanums
  • X-drives

0 voters

thanks! the code for mechans and xdrives are the same, the use rollers at a 45 degree angle to strafe

Mechs and x drives can move in all directions. I would definitely search up some topics on the X vs mech debate as there are good arguments for both. Assuming by vertically you mean left to right yes both of those drives can strafe.

It doesn’t look like they even sell mecs anymore. Vex doesn’t have them on their website.

They still sell them



thanks! do they sell them larger? or is that just the one size?

I maybe wrong but I’m pretty sure it’s just one size

Yes just on size of mechs

I never said that mecanums were better than an X-Drive. That’s just what my team has used before

1 Like

Screen Shot 2020-05-17 at 5.23.51 PM
Vex certainly still sells them


Mecs vs x drive is all situational.
Mecs are simpler to build and have good torque but dont storage sideways as fast.