I have a quick question about the WPILib VScode plugin. I love how well it works, and as I delve into doing more with it for my summer projects (just successfully tuned a 2020 PID Controller :), I realize, it would be neat if we could add custom team-specific templates to the WPILib New Project wizard.
I realize that every time I create a new project from a template (not example), I find myself changing a bunch of things and adding the same ToDos and basic boilerplate (Our drivetrain for practice bots is usually CTRE based, and Our drivetrain for the competition is REV). I would love to automate some of that for the team.
Can anyone direct me to the resources to begin to figure out how plausible this would be?
Would we need to create an entire custom install of VSCode, or is there a (or some) JavaScript file(s) we could alter?
Our take on this was to have our base drivetrain class (which supports CTRE and REV motor controllers) in our year-agnostic library, and just access that in a specific year’s robot code. This approach also lets us have a unified code base across the multiple robots our software team is working with and cuts down on rewriting code each year.
There is actually functionality to do this already.
This loads JSON files matching the IJsonExample interface from WPILIBFOLDER/vendorexamples folder, and puts them in the examples dropdown. Note I haven’t tested this in a long time, but it should work. If not, PRs or issues happily accepted. Also not opposed to adding a way to make these show up in templates rather then examples, likely with an extra bool flag on IJsonExample, again PRs happily accepted.
These are wonderful replies and exceptionally helpful. I am fully aware that there are times when boiler plate can help us learn, but the unified codebase is certainly the goal. There are many ways proposed about how to do this. I wish I could mark multiple solutions :).