Mecanum Wheels Code

I know this is not Vex Coding Studio, but I am having trouble coding my mecanum wheels. Anyone have some sample code I could use? Im trying to have the left joystick control regular drivetrain motion while the right joystick controlling the strafing

There are some helpful explanations for what you are trying to do in this post:

1 Like

Check out Kepler electronics video about how menums work. Should be simple to program off of that knowledge.

Here’s a bit of our code so you know the syntax. A means front and B means back. You might have to reverse some of the pluses and minuses.

    leftMotorA.spin(vex::directionType::fwd,Controller1.Axis3.value() + Controller1.Axis1.value() + Controller1.Axis4.value(),vex::velocityUnits::pct);
    leftMotorB.spin(vex::directionType::fwd,Controller1.Axis3.value() - Controller1.Axis1.value() + Controller1.Axis4.value(),vex::velocityUnits::pct);
    rightMotorA.spin(vex::directionType::fwd,Controller1.Axis3.value() - Controller1.Axis1.value() - Controller1.Axis4.value(),vex::velocityUnits::pct);
    rightMotorB.spin(vex::directionType::fwd,Controller1.Axis3.value() + Controller1.Axis1.value() - Controller1.Axis4.value(),vex::velocityUnits::pct);
1 Like