Quote:
Originally Posted by sasha831
I've already posted this in another thread, but our team developed our own Java Library, as we had a lot of issues with the default stock code. It can be found here:
http://ai-robotics.com.au/code-libraries/
I am very happy to help any team that needs help programming the mecanum wheels, regardless of whether they are using our library or not
|
Team 2465 (Kauaibots) has been working with mecanum for a few years now. We're one of those teams that will hopefully have a singing mecanum driver system.
Like the fine folks at ai-robotics, we'd like to make our mecanum drive code available too - in the hopes that other teams find it useful. I sincerely hope this won't steal the thunder from ai-robotics' excellent work, but since the Kauaibots code has some unique features, we wanted to post this on this thread.
This is a custom implementation of mecanum drive, based on
Ether's incredibly thorough and enlightening documentation that was posted a few years ago.
To this, we added two things:
(a) Velocity PID control of CAN-based black Jaguars (for traction control, which could come in handy this year). We note that mecanum is sensitive to weight distribution, and a velocity PID is very useful to help deal with this issue. You can disable this if you want.
(b) integration with the nav6 IMU for a field-oriented drive that exhibits superior accuracy (typically, yaw drift of about 2.5 degrees over a 2:30 minute period, the FRC match length). Like the ai-robotics code, you can disable this if you want, too.
The java code for this is
available online. See the Drive.java file.
You might also find the "AutoDrive.java" and "StickDrive.java" files useful, they're up one directory, then down into the "commands" directory. The StickDrive implements a set of joystick response curves we've found useful.
Team 2465 partnered with Kauai Labs to design the new open-source navX MXP Robotics Navigation Sensor. The navX MXP is compatible w/the nav6, so you should be able to use either board with this code. Alternatively, the kit of parts gyro can be integrated into it, although we find the nav6/navX provides greater accuracy.
There are a few tuning parameters (the robot wheel base and the wheel diameter). We've tested this on both 6-inch and 8-inch Andymark mecanum wheels, on both square-shaped and rectangular chassis. Our favorite configuration is a rectangular chassis with 8-inch wheels. This has enough pushing power to push one of the adult mentors sitting in a chair (the chair doesn't have wheels) across a carpeted floor.
This code is for the CRio; We haven't yet ported this to the RoboRio, but we'll be posting the ported code soon.
Aloha,
- scott