Mecanum wheeel blocks code

I am currently trying to code mecanum wheels for my robot on v5 blocks and cannot figure out how to do it. I was hoping you guys could help. thanks in advance.

1 Like

You will need to do this code with 4 motors and you will have to experiment with the axis. Screenshot_20200510-104644_Photos

2 Likes

I will try that thank you.

No problem. I had to use that last year before 4 motor drivetrains were able to be in vexcode blocks.

Also check the example programs and see if there is something in there. I am without a computer rn otherwise I would look.

For the Mech Wheels you are going to have to add (or subtract) something to have it strafe in the correct proportions.

1 Like

image

I had kid also set up the bot with tank drive, and then if the moved either stick from side to side it would strafe.

I would not use the drive train because you won’t be able to do the strafing.

Your solution will look no more complicated than when @turbodog posted, but then you will also have to spin the wheels on a separate line.

Figure out how the want the bot to move with what sticks, and we can help you more if you can’t quite get it to work. Try to add in one or two axis at a time.

1 Like

i have the code from my previous team for mechanum wheels and when I downloaded it the wheels wont even move.

here is the code.

frontR.spin(vex::directionType::fwd, Controller1.Axis3.value() + Controller1.Axis1.value() - Controller1.Axis4.value(), vex::velocityUnits::rpm);
frontL.spin(vex::directionType::rev, Controller1.Axis3.value() - Controller1.Axis1.value() + Controller1.Axis4.value(), vex::velocityUnits::rpm);
backR.spin(vex::directionType::fwd, Controller1.Axis3.value() + Controller1.Axis1.value() + Controller1.Axis4.value(), vex::velocityUnits::rpm);
backL.spin(vex::directionType::rev, Controller1.Axis3.value() - Controller1.Axis1.value() - Controller1.Axis4.value(), vex::velocityUnits::rpm);

Did you name the motors the same and put them in the same ports?

we made it so it was our motor names and ports were the names. the motors wont move when we move the controller.