programming mecanum

hi, our team is going to use mecanum wheels this year, but I dont really know how to program that
and when I tried to use the code from the examples, (actuators - mecanum drive) but it didn’t worked - if I tried to drive forward or backward, so it works (but really bad) and sometimes after a few seconds (after forward / backward drive) so the robot is driving to the side (usually to the right) for 1-2 seconds
any code / advice / tips / etc ?
thanks in advance

Put your robot on blocks, then test it. If it works as expected on blocks (ei wheels rotate correctly), then you can safely blame the building team.

OK, first the obvious mechanical thing:
When you look at the robot from above, do the rollers form an “X” pattern? If looking from below, you should have a diamond pattern. If not, move wheels around.

That’s next - put it on blocks. If it isn’t correct, note which direction each wheel rotates when driving forward, rotating right, and strafing right.

  • The left front wheel should go the same direction in all three cases.
  • The left rear wheel should go a different direction when strafing right than the other two cases.
  • The right rear wheel should go a different direction when rotating right than the other two cases.
  • The right front wheel should go a different direction when driving forward than the other two cases.

Move signal, code, or power wires to make the situation look like that list. Then, if any of the wheels are then rotating in reverse when driving forward, invert that motor controller.

If wheels change direction with the joystick in a constant location while on blocks, you have bigger issues. Send details and we’ll help as best we can.