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++.
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.
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.
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.