ftc mecanum code

Hi I was wondering if anyone had any FTC mechanum teleop code.It would be greatly appreciated

Not exactly what you asked for, but for frc we just implemented Ether’s math (click here for the documents) and went from there. Start with the “mecanum & omni with gyro for field-centric control”, it should give you all the math to setup the motors initially. If you don’t have a gyro you can just set it to zero or not include it at all. Hope this helps!

Don’t skip the gyro, it’s the difference between frustrating year and an awesome year. :wink:

You don’t have to use field centric control with a gyro either, that can be a headache too.

the problem with the gyro is we don’t have a gyro to use . i am also not very good at coding so i don’t understand how to do a lot of stuff with coding.

https://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NGY1044

This one should work for your purposes and wouldn’t be hard to wire.

this will work but i would prefer a code that doesn’t require the gyro because this is kind of expensive and also the mechanum wheels cost $60 per set of 4 and we want 2 sets so thats $175 with gyro so it is expensive.

You don’t need the gyro for Mecanum. We used it just fine without it this year. It is true that it would give a better experience but it totally is extra something to do if you have the time (and money).

It is something we have planned on adding every year never gotten it done. Now our switch to RobotC might make it harder to get to it this year.

Do you have any teleop code from your mechanum code from previous years

Here are the screen shots of our code.
There are 3 pictures.

The way it works by adding and subtracting the values of the joysticks depending of the wheel. The middle attempts to normalize the value of the joysticks because if you don’t it will end up driving really fast all the time.

**I have not included our code from last year directly because we had a really weird problem with our code that we couldn’t figure out. When ever the joystick value got higher than aprox. 100 the motor outputs were reversed. I rewrote this code several times and could never get it to work.









thanks so much for the screenshots these will come in handy for programming our robot. i really appreciate it. now my team will be able to do mechanum. we have been debating on whether or not to use mechanum it all depended on if we had code or not.i could talk to one of our coders to fix your code problem.