Our team is working on autonomous for our MK4i swerve drive. We are using the SwerveDriveSpecialties base program, but are having troubles reading distance travelled. We also noticed that the SDS code doesn’t create a swerve module in the same way that wpilib sets it up, so that has caused some problems. Is there an easy way to instantiate the MK4i with WPILib’s code? Any input helps. Thank you!
SDS template and such haven’t proven to be great over the past year. If the template still uses the unmaintained swerve-lib, well that’s a problem. A better, more traditionally styled base for swerve modules can be found here: GitHub - Team364/BaseFalconSwerve
You didn’t mention which motors or turn encoders, but we finally today got our NEO / CANCoder / MK4i code working including with auto: GitHub - SuperiorRoboworksTeam857/2023SwerveTest: 2023 test of swerve code
Kudos and thank yous to Team 3457 for a well maintained version of SDS swervelib.
You’ve been given some good advice already, but don’t discount the WPILIB example SwerveBot code.
Agree that @democat deserves HUGE thanks for keeping his fork of the SDS swervelib updated and maintained. It’s working perfectly for us. We have to use SparkMax and NEOs due to the shortage of Falcons. And it seems like every other SDS library and general Swerve library is only able to use Falcons. Having a library that supports both Falcons and NEOs, including a mix for steer and drive, it so helpful to us, especially as Swerve Drive newbies. (That said, unless I am mistaken, based on his GitHub bio, democat is with FRC Team 5431. )
I’d encourage the OP to take a look at that fork.
Ahhh… a bad assumption. Thank you!
That’s strange, and definitely not the intention. I would check that your inputs are what you expect. We use the template as a reference and haven’t had any issues like that.