How to go about using utils in java?

So I’ve been looking at other team’s codes for inspiration and looking back at some of my own team’s old libraries and im noticing alot of utility classes being used. Whether these be based in a seperate repo or on the main robot code repo itself it includes classes ranging from all sorts of things such as Limelights, Controllers, Pneumatics, etc.

What I was wondering was how would I create my own versions of these? How do I make them original (if possible at all) What should I create them for? If anybody has any ideas/examples I could go off of that would be greatly appreciated.

For my team, I’ve looked at creating a separate utils repo but so far we just have a utils directory that we just copy from robot to robot or I’ll add it to our repo template so it’s already there. We don’t have too many utils at this point so hasn’t been an issue.

Our team uses a custom vendor library called SuperCORE to handle everything you listed and more. This was a lot of work to setup but is very quick and easy to use since we can install it by simply pasting a link in VSCode.

1 Like

I see, how useful do you guys find this feature to be? In terms of consolidating code?

Consider using jitpack:

https://jitpack.io/

1 Like

There is a also a way to use github as a maven repo. You can use it with precompiled libraries.

Its a little more complex than jitpack.

Our team maintains our own utility library using jitpack called StuyLib.

You can look at the project structure to get an idea of how it’s maintained and i’m happy to answer any questions you have.

1 Like

Don’t create them just to create them. If you find yourself reusing a section of code a lot, refactor it into a reusable class or method. Taylor it towards the way you write robot code. But don’t just make a library because you think you need a library.

5 Likes

My team already has our own little utility library using jitpack, I was just wondering what I could add on to it.

1 Like

Definitely will be looking at this, thank you

Are there any features you find yourself wanting/using every year, that aren’t yet available in the standard FRC libraries?

Very useful. Since it’s a vendor library it’s easy to quickly install and update. It has a few other cool features but for the most part it’s just like a normal vendor library.