What's the best library/sources that I can learn from about Swerve Drive?

My team is getting prepared for the next season and we’re about to implement swerve-drive into our robots and of course need to program them as well, however we don’t know much about it code-wise, what are the best sources that I can refer to?

1 Like

364’s base falcon swerve code

Best swerve base there is.

1 Like

I think this library only works for Falcons which teams cant get until early 2024 anyone have resources for neos with mk4i’s?

I have a UltimateSwerveBase project, but youre going to have to modify the 2nd order kinematic stuff (have not tested it) to be regular swerve kinematics but the neo swerve code does work, the goal of the project was to be compatible with all hardware.

1 Like

YAGSL is a generic option.

CTRE’s new tuner will program your JAVA for you so swerve ‘just works’. Of course, you need to use CTRE’s motors.

1 Like

Here are the existing options:

  • 364’s swerve base has already been outlined.
  • REV MAX Swerve base is generally specific to, well, MAXSwerve.
  • YAGSL is great for getting swerve to “just work” but may not be ideal if you want to program everything, including the fine details of module control.
  • WPILib SwerveBot template uses entirely PWM motor controllers and DIO encoders, but gives a good template for what a proper swerve drive code layout looks like.

The best way, in my opinion, to learn how to program a swerve drive is to look at other team’s code, or the source code of these generic options. Ask other programmers what struggles they faced and how they solved it; we’ve all been through a million problems on our way to finished and working swerve drives.

3 Likes

Couldn’t agree with this more, when developing YAGSL I had looked at every Swerve project i could find to figure out if i was doing something wrong. Helped immensely and I even link to sources which i had used a portion of their code in YAGSL.

3 Likes

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