PathPlanner with CTRE Swerve drive

Our team is in our first year of using a swerve drive. We use pre-assembled Mk4i’s with Kraken X60’s, CANCoders, and a Pigeon 2.0.

We used Tuner X to generate code for our swerve, unfortunately, due to issues with git/github, we cannot currently upload our code for others to see.

We have decided to use PathPlanner to create and run our autonomous routines, but we don’t know how to setup our code to do so. Can anyone please share some sample code or a guide on how to do this?

Any help is greatly appreciated!

Have you looked at the path planner example on ctre’s github?

2 Likes

Cosign here - that example is great and it just works.
Run the CTRE wizard and generate your constants file - then just drop it right into their pathplanner example.

1 Like

I did exactly that, but when I dropped in my TunerConstants class and performed a build I got a ton of errors, so many that I uploaded to mozilla pastebin (pastebin is banned on school network) Mozilla Community Pastebin/NfRAdp2Z (Java)

I’ll take a look at it when I get to a computer but I would make sure you haven’t crossed the streams on versions. (2024 with 2025)

Did you install PathplannerLib?

You did build from the wpilib menu, right? I only ask cause we had a freshman last year try to just do java robot.java