PathPlanner Confusion

Hello everyone, I am the lead coder for my robotics team, team 9075, and have been assigned to face the ultimate fear, swerve drive auto. I understand that PathPlanner is an excellent tool that many teams use for autonomous, but I am extremely confused. All that has been left for me is our competition code from last year, but really no information other than that. What I am ultimately trying to say is that I have no idea what I’m doing when it comes to autonomous and I am hoping that someone could help me figure things out. If anyone has any questions, I will do my best to answer. The github link for our code is here: https://github.com/9075-Lunar-robotics/2024-Crescendo-Code

Edit: I probably should’ve mentioned this before, but we use the MK4i swerve module kit, with neo brushless motors, sparkmax motor controllers and a pigeon 2.0

Start from the documentation, and come back here for questions!
https://pathplanner.dev

1 Like

Are you newer to programming swerve? Our team uses YAGSL to program our swerve, and there is a lot of support for it and it is pretty simple to start building auto paths once you get the swerve properly configured.

I am new to programming swerve, I have some knowledge with programming in general, but swerve is entirely new to me. One of the things that confuses me the most is that our previous coder had built some paths, but was never able to get them to actually be executed by our robot, it has also become apparent to me that the code I have linked is slightly out of date, and I do not know how to update code on github, being my first year using it.

What is your swerve module, swerve motors, encoders and gyro?

we are using the mk4i, with neo brushless motors, sparkmax motor controllers, a pigeon 2.0 gyro, and cancoder encoders.

You can manage the github repository using your VSCode project.
Get the github URL for your project from the github Code drop down and click the overlapping squares icon to copy URL to clipboard
image

Open VSCode without a project and open the command palette.
Type the command git: clone
paste the URL for your repository in the input field.

I can’t see anything in your repository otherwise I would have used it for this example.

You may get a request to logon with your password to github at some point to establish vscode can write updates back to github.

As changes are made on your PC you can push, 'pull, stage, commit changes. I haven’t gone into those details here. If you decide to use VSCode and GitHub for version control then get a cheat sheet or instructions. I might be able to find my team’s version if you want them.

Alternatively you can just upload files back into github as you want them saved in github - crude but it does work for a single user.
image

That’s similar to what we had last year. YAGSL worked really well for us last year. It has a built in configuration tool for the hard ware you have. You can copy their example code, go through the generator and input your CAN ids and hardware, get the swerve encoder offsets, and start tuning pids or driving around. If you have any questions, the YAGSL developers are very good at answering them or the community because several teams use YAGSL.

Once you got through those steps, drawing paths in PathPlanner was very easy, because path following is already built in.

Should I make the code public? It was marked private before and I didn’t know if it was still able to be viewed with a link or not.

Your repository appears as public and empty. A link is always used but only authorized users can see a private repository.

I have made the github page public, you should be able to see it. My main concern is, as stated earlier, the code on github is out of date in comparison to what we have in our current visual studio code. I tried using the method you had previously shown but that just created a copy of our github code into a new file. Will I have to update the code for that file or is there another way that I can show my current code on that same github link?

I think your code may be on another branch in that repository ( this is indicated by the pull request to pull the secondary branch into main ). However this was never actually approved and merged. Looks like the other branches where edited 11 months ago.

A github repository is just a version control software. You can create branches which are snapshots of code ( and edit each snapshot independently ). It looks like you currently have 3 branches ( the main / primary branch , a branch called test , and a branch called 9075-Lunar-robotics-swerve-drive-(for-clayton) ). Id look into those other 2 branches and find your code.

1 Like