Mechan Wheels

So I have been looking at different types of drivetrains and I realised that lots of teams use x-drive or mecanum wheels, but when I go to see videos on how to program it, they are all set for arcade type driving. Is there any way to get the strafing while using tank drive using the buttons to move sideways?

Yes. Program it the same way you’d code a tank drive and have the buttons control the sideways motion.

2 Likes

Is there a way to where I can go diagonal as well, because when I tried that I could not go diagonal

there should be a way. you spin the set of wheels on opposite sides. ex. front right and back left would spin at the same time then it would go diagonally

Yes, but I’m not sure how clean it’ll be. In code, make each button act as a value of 100 (if you’re in percent, it could be 200 rpm or whatever) and add it to the inputs from the tank drive.

The output for the front right wheel looks like

rightjoystickvalue+leftbutton.pressing()*100-rightbutton.pressing()*100

This should get you close to what you want

1 Like

Thank you so much guys!

try this for arcade drive where left joystick is movement and right joystick is turning

while (true) {
    double forward = Controller1.Axis3.position(percent);
    double right = Controller1.Axis4.position(percent);
    double turning = Controller1.Axis1.position(percent);
    double leftFront = forward + right + turning;
    double leftBack = forward - right + turning;
    double rightFront = forward - right - turning;
    double rightBack = forward + right - turning;
    wait(100, msec);
  }

spin the motors based on leftFront,leftBack,rightFront,rightBack

It should work for both mecanum and x drive

3 Likes

Thats pretty smart except where he said he didn’t want arcade

6 Likes

True, but there’s a reason why holonomic drives use arcade-style controls and not tank. Can it work the way OP would like, yes, but it will not provide the same usability as a traditional arcade-style holonomic control layout. Using buttons to control strafing means that the strafing “vector” will either be “on” or “off” and the operator will not be able to feather the lateral component.

5 Likes

2 Likes

A little tip I learned when using mecanum wheels, when going diagonal you get the best results if you have the motors that are not moving locked (or I would have them moving at 1%), that way they don’t freely move causing the robot to move more forward than sideways

5 Likes

I built a mecanum drive a few years ago as an off-season project, and because I am also very impartial to tank controls, I wanted a way to strafe while maintaining the tank controls I was so familiar with. The way I achieved this was to make the side to side motion controlled by the horizontal axis on the left joystick (could have been the right as well, just personal preference), so that to move sideways, I would just shift my thumb sideways in the direction I wanted. my driving with this bot was very limited, but it seemed very comfortable for me, much more so than a split arcade setup.

2 Likes