Team 4048 - swerve drive code release

FRC Team 4048/Redshift has used the AndyMark swerve drive modules the past 2 years. Last year’s re-write was made in a more portable/layered form so that it can be more easily adapted to other off-the-shelf or custom swerve modules. Since swerve is not natively supported in WPIlib we’re releasing our Java and C++ versions. Links to the Git repository are on our team web page:

http://team4048.org/software.html

The Java code is fully tested and working. The C++ code is really close but needs more debugging to make it work right. There is also a LabVIEW version that was working when last used; but it’s been a while since we’ve tried it so we need to take another look before posting it.

The code supports 8 motors (4 for steering, 4 for driving), uses Talon SRX controllers for PID steering, and a gyro/IMU for field-centric driving (switchable to robot-centric).

tkx

Thanks for sharing! A couple thoughts:

  1. Do you have a list of the public API’s? AKA, what are the methods the user is expected to interact with to make the code do its thing?

  2. Awesome job putting in testcases!

  3. Any plans to release this as a gradle artifact for easy pickup in 2019?

I’m going to beg a little ignorance here as it’s been a while since I looked at the code. That said…
(1) I thought the sample code had this covered. But if it’s not obvious than clearly it needs more/better documentation.
(2) tkx!
(3) No plans here.

The hope is to get the current C++ and LabVIEW version debugged when school starts again in the Fall. Beyond that, any code changes will all depends on how much student and mentor time we have before the 2019 build season starts. Looking ahead to 2019 - one gotcha for 2018 when we wrote this code was that CTR Electronics made major changes to the TalonSRX interface. If a change of that magnitude were to occur again, there’ll be more work to be done (of course one can always use a software PID instead of the one in the TalonSRX and not worry about the CTRE library).

Any and all suggestions are welcome.

tkx
-lou

Looks like move(double fwd, double str, double rcw, Double gyroValue) out of SwerveDrive.java

Ah, fair enough, I missed that. Teaching by example works great!