Custom Robot Netbeans Libraries

After the last two years, our team has developed a few utilities to aid in our programming (namely an Xbox class and a Socket connection for a RPi). I would really like to make a Library project in Netbeans and use it in our production code.

I have however run into a few problems, which after some searching, that I haven’t been able to resolve.

  1. The library project needs the wpilibj.jar and squawk.jar and potentially also the networktables-crio.jar libraries depending on the classes in the library. The actual issue is making sure that adding these libraries would carry not only between computers but between Platforms. I know that the FRC plugins would know where they are, is there a way I could reference it through them?

  2. How do I add a custom library to an FRC project. I searched through several dialog/property windows looking and couldn’t find it… And once I DO add it, how can I ensure it will transfer easily between computers and platforms, likely referencing the NetBeansProjects directory?

Any help is greatly appreciated.

One thing you could do is recompile the WPILibJ libraries from their sources including your utility classes – although this is a fairly dirty solution. You’d have to distribute the library to those wishing to use it and have them add the libraries to the cRIO. The issue with not being able to add libraries to your project is that the platform on which it runs, the cRIO, is a static platform, and won’t have extra libraries. I’m not sure if there’s a [non hacky*] way to add a library that is assumed to be on the cRIO. In the end, there is no easy way to do this, unless you want to distribute sources.

*You could use a ClassLoader and reflection to access classes from the library, but then all end-users would have to take a similar path.

In the ant buildscripts, there is a variable called ${sunspot.home} which is set to the path shown in Options->Miscellaneous->FRC Configuration. If you make sure you place your library relative to the sunspotfrcsdk directory, it should work.

Note that per R16, any library you carry over from year to year must be publicly released.