Help With Swerve Drive

Hey there, I’m one of the programmers for team 2509, and up to this year our current team has only ever worked with mecanum drive. We’re currently basing our current program off of team 1706’s swerve drive from 2022, however we are using TalonFXs currently (waiting on our new Kraken motors which we will replace the TalonFXs with in the future,) and after having made a skeleton program that theoretically should be driving, nothing works whatsoever in practice.

Much similar to what we are basing our code off of, the driving command (which we have referenced as TeleDrive,) there seems to be the problem within the execute() function, as no values are output to the smartdashboard. I was wondering if anyone may notice anything of concern within our program which may cause for a failing drive train.

Further details: our wheel positions/transitions are specifically tuned to our robot, all motors are on the correct ports alongside the controller.

Here is our program: GitHub - HutchinsonTigerbots-2509/SwerveTest2024: Testing Swerve Drive

To be honest, at this point I would strongly recommend opting to work from a more modern codebase only because 2024 has brought in some new features that should help out with swerve a fair bit. We personally used the AdvantageKit 2024 template as it was simple, reliable, and already had AdvantageKit and Pathplanner built in. It also has builtin configs for TalonFX so it should be a fairly easy transplant.

The code structure might seem a little wonky at first, but once you understand it, it’s actually really simple and straightforward. A major side bonus of this approach is that you also gain AdvantageKit integration, which is amazing for troubleshooting, especially as you start working on mechanisms and autos. Definitely something to look into.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.