Swerve Drive Specialities MK3 code

Have any team heard about the MK3 code update?

I was looking in the Serve Drive Specialities github, posts and webpage.

Thanks…

1 Like

Our team is also haveing difficulty finding swerve drive MK3 code an update would be great… thanks

1 Like

If you don’t find any example code from them, these might help at least.



There’s also a “SwerveBot” example provided with WPILib’s vscode extension that incorporates these. Here’s how to create example projects.
4 Likes

I don’t think any official SDS MK3 code update will be coming soon. The SDS template code imports 2910’s swerve code. Unfortunately 2910 has not been able to meet in person since last March. We are hoping to get approval to meet outdoors, but that is seeming quite unlikely. We have been unable to test our code updates.

Not much should need to change on the MK2 template code to make it compatible with the MK3. The only main difference is the steering encoder.

I believe we (2910) were transitioning to using more of the WPILib built in swerve stuff. Taking a look at all the built in WPILib swerve code would also be a great place to start.

There are quite a few teams that have MK3 Swerve module robots up and running. If anyone would like to share their code that would be great!

2 Likes

My team was working on that last night or two nights ago. I’ll see if we can post what we have on github once we know it works because it seemed pretty close.

3 Likes

I just recently revisited this paper and the code supplied…

This isn’t specific to an MK3 but the basics of calculating wheel angles and speeds still applies.

Worked great for this bot:
https://www.instagram.com/p/CJldu4GHo-V/?igshid=fyvv9qh9bz7i

1 Like

Did your team get it working?

1 Like

They did not. We got hit with a covid stoppage and they may just be switching to MK2’s because we’re falling behind. We’re trying to run a normal-ish build season with limited hours to see if we can close at 8pm every night.

I have an alumni who I mentored on a different team back in the day who just moved back to the area coming to our shop sometime this week to look at it. I’ll let you know if he’s able to figure it out. I think he should be able to get it figured out pretty quickly. It’s just an encoder math problems

Good luck!

If you can get mk2’s working, you should be able to get mk3’s to work. Like patrick mentioned the only difference code wise is the encoder used, and that is just a few lines of code change. If you have specific questions feel free to post them and someone can probably help you out

I’ve asked them to layout what they’re having issues with and post on here. Stay tuned!

I’m curios how are you wiring the srx mag encoders back to the spark max controllers?

I think they’re using the CANCoder now, which just lives on the CAN bus and can be polled from code whenever you need it.

Edit: Here’s a link to a thread that talks about interfacing the SRX mag encoder with a Spark Max. It seems like it’s just a matter of crossing over some wires.

Hey y’all - I threw together an example project of how to get the Swerve Drive Specialties MK3 up-and-running using Falcon 500 motors and a CANCoder to measure the module angle. Hopefully others will find it helpful.

It’s based on the WPILib SwerveBot demo project. If you’re not familiar with that code, start there, and come back to the swerve example repo for the integration bits.

7 Likes

Check this out: Working MK3 swerve - Programming - Chief Delphi

1 Like

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