Quote:
Originally Posted by daltore
2) Mechanum has fewer losses than omnidrive doing forward, but has huge losses strafing. Going diagonally can cause interesting vectors to result accidentally. Definitely the loudest of the drive trains when strafing. Simple to build, more expensive than most of the others (depending on how you make swerve drive, and if you make your own mechanum wheels), hard to conceptualize. Possibly hard to program, I don't know, I haven't tried.
|
Here's our RobotC code from 2008. There are a lot of lines and redundant variables for debugging.
Code:
/********** Mecanum Code **********/
int FL_X, FR_X, RL_X, RR_X;
int FL_Y, FR_Y, RL_Y, RR_Y;
int FL_Z, FR_Z, RL_Z, RR_Z;
int X, Y, Z;
int FL, FR, RL, RR;
void drive (signed int joyX, signed int joyY, signed int joyZ)
{
char reduce = 3;
if (joyX == 0)
reduce--;
if (joyY == 0)
reduce--;
if (joyZ == 0)
reduce--;
else
reduce = 3;
if (reduce==0)
{
motor[mtrFL] = 0;
motor[mtrFR] = 0;
motor[mtrRL] = 0;
motor[mtrRR] = 0;
FR_X = RL_X = RR_X = FL_X = 0;
FR_Y = RL_Y = RR_Y = FL_Y = 0;
FR_Z = RL_Z = RR_Z = FL_Z = 0;
return;
}
else
{
FL_X = -joyX / reduce;
FL_Y = joyY / reduce;
FL_Z = joyZ / reduce;
}
X=FL_X; Y=FL_Y; Z=FL_Z;
RR_X = FL_X;
FR_X = -FL_X;
RL_X = -FL_X;
FR_Y = RL_Y = RR_Y = FL_Y;
RR_Z = -FL_Z;
FR_Z = -FL_Z;
RL_Z = FL_Z;
if (1==1)
{
motor[mtrFL] = FL = (FL_X + FL_Y + FL_Z);
motor[mtrFR] = FR = (FR_X + FR_Y + FR_Z);
motor[mtrRL] = RL = (RL_X + RL_Y + RL_Z);
motor[mtrRR] = RR = (RR_X + RR_Y + RR_Z);
}
}
Our team is going to try and prototype a swerve drive this winter break (before kickoff) but in all likeliness we were going to do 6WD. Reliability is greater than all. If you can't drive, you can't play. In all honesty, your team's resources will probably be better going toward a better arm or better autonomous than developing a crab drive. Mecanum has low traction which fit 2008's game as there were basically rules against defense, next year's game will/might include pushing matches.