mecanum joystick selector?


i have a mini mecanum bot, im trying to program it (programming is not my area, building is)

i need it to do single stick drive , then when i click the trigger of that stick, and move the stick sideways, the robot will go sideways.

i thought it would need two drive codes one for sideways and one for skidsteer, and a simple if statment between them.(this didnt work)

im pretty shure my concept works, i jsut need a little help putting it into code, could someone translate this into C, or shoot me in the right direction? or if this is the totally wrong way to do this, help?

IF (trigger pushed in)
then (do sideways code)
otherwise (do skid steer code)

Devo

Edit: i dont need mixing values or mecanum code, im having trouble with a selector.

Hi Devo, Please allow me to “shoot you in the right direction”

A search on “omni holonomic mecannum” will yield at least 25 threads on this subject. It will include different takes on the math, snippets of code and a wealth of documented experience on this subject - going back 5 years.

enjoy,
Eric

send me your email and I can send you some of our mecanum stuff. we programmed up a vex to use mecanums when were developing our FRC code.

Brian
[email protected]


  if (p1_trig)
  {
    strafe();
  }
  else
  {
    skid();
  }

Replace the strafe() and skid() calls with whatever you use to drive the robot.

It looks like you have the wheels on backwards. There’s enough of a difference between the length and width of the chassis, so it’s not a huge problem, but I think your robot might have a hard time spinning in place under its own power, and might find it hard not to spin in place when something is trying to push on one of its corners.

If you swap the front and back wheels on each side, you’ll make it more able to spin only when desired. (You’ll also have to change the software to account for the change, of course. That could easily be as simple as switching the sign of one or two computations.)

This is a separate topic from software, so I’m putting it in a separate reply.

yeah i did put the wheels on backwards, i had them on correct but wanted to know what changed if they were on backwards. so i flipped them around, but never changed them back because it works about the same. i never really thought about the spinning or pushing power. so ill correct the wheels

Devo