Hello everyone! Our team is trying swerve drive for the first time and we need some tips for programming. We are using Swerve drive specialties swerve modules and a falcon for driving and a neo for angling. Does anyone have any sample code or tips to get started? Thanks! My name is Programming Paul 34.
There’s a lot of learning resources for coding swerve, one my team used and modified this year was the 0 to autonomous video
if you’d prefer more customizable libraries you can look at YAGSL (yet another generic swerve library) or base falcon swerve
Hi Programming Paul 34, welcome to the world of swerve drive, please consider using the search function before posting!
Im sorry. Im new to chief delphi. I didnt quite understand the function
Oh, no worries! There are a lot of good resources out there like what was linked above, but as a bit of a more personal recommendation, ensure your encoders are what you expect them to be, I know of one team that didn’t realize that they hadn’t gotten the encoders they expected to need, and that could end up being a bombastic problem.
This is a really cool coincidence because I was just developing a Neo/Falcon swerve for my team, that waded forked off of 364’s Basic Falcon Swerve. The reason why I am adapting it rather than building from scratch being that 364’s code already works with Pathplanner. I personally wouldn’t recommend using YaGSL as it won’t work for a neo and falcon swerve drivetrain. I could neither make one using the library itself nor change the code in order to add an option for neos.
The main this you would have to change would just be the Swerve Module class and some constants, and therefor would have to change the Swerve subsystem.
Huh? YAGSL is designed to support a drive train with both?
The latest version may be simpler for you because you need to specify the conversion factors yourself instead of relying on math being handled in the library.
The wiki for the JSON is here, it isn’t updated for the latest version, but the only difference is angleEncoderPulsePerRevolution
is removed.
When you define a motor you have the option to choose the type
which should be “sparkmax”, " neo", or “falcon” then the accompanied CAN ID and CAN bus (if it is on a separate CAN bus) according to the setup.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.