I have a robot with four mecanum wheels and I would like to make it move correctly by using a RC transmitter (my controller has two sticks and several buttons, each stick has a proportional range of [1000 - 1500 - 2000] where 1500 is the center position).
I've read different documents about how to control a robot with mecanum wheels, but I wasn't able to find any suitable example to use as starting point.
Basically, I would like to understand what kind of algorithm I need to use to set the velocity and the direction on each wheel depending on the stick position.
The motor controllers I'm using for my robot use a proprietary language, so I do not need any code, I just need to know how it should work and then I'll translate it to make it work with my electronics.
I hope you can help me!
EDIT: I was thinking something like this:
left stick UP = forward left stick DOWN = backward left stick RIGHT [UP/DOWN=0]= SLIDE left left stick RIGHT [UP/DOWN=0] = SLIDE right left stick UP/RIGHT = diagonal and so on.. right stick RIGHT = turn on RIGHT right stick LEFT = turn on left
my joystick has a left stick with two axes and a right stick with two other axis. Both stick are proportional.
The figure shows the directions I would like to implements for my robot. In order to keep things simply, we can not consider the turning on rear axis and on a single wheel.
My motor controllers move each motor by using motor_command function which ranges from 0 to +/-1000, where 0 means motors stop and +1000 means motors at 100% forward while -1000 means motors at 100% backward.