Log in

View Full Version : Building Custom WPILib


Peragore
06-02-2014, 17:17
Hey Guys, 3373 here.

We are going to be using a RPI to do our vision processing this year, and have the networking all set up on the test end. However, when we go to copy this code over to allow us to use it on the cRIO, we run into regex problems (using String.replace("/0", "") tells us that we cannot convert string to char). Looking into this, I concluded that regex is not included into WPILib java. In order to fix this, I tried to build it into a custom WPILib. However, much to my dismay, I found that whenever I would go to rebuild as per the instructions, the package I added was not in the new build of the code.

Any help here?

Joe Ross
07-02-2014, 01:15
Why do you need to build it into wpilib? Why can't it be implemented separately?

Have you followed all the steps here? http://wpilib.screenstepslive.com/s/3120/m/7885/l/79739-building-with-a-custom-version-of-the-wpilib-source-code

Arhowk
07-02-2014, 08:12
Wouldn't it just be easier to create your own stringReplace? (if thats the only regex you use)

Peragore
07-02-2014, 15:43
The problem I am running into is the fact that String.replaceAll and String.Replace relies on regex, which WPILib doesn't have

Joe Ross
07-02-2014, 21:51
The String class is not part of WPILib. It is part of the JVM, which you can't change. Therefore, I'm not sure why you are trying to change WPILib, and not implementing it separately.

Are you really trying to search for the two character string "/0", or are you looking for the null character '\0'.

Peragore
08-02-2014, 13:51
Yeah, I meant "\0". I found a way to get around my need for regex in the parsing code. However, I do find it strange that components of the JVM in Java are not included in FRC Java (Math.pow, java.util.regex.Patternm etc). We have written stuff in in the past, I just failed at implementing regex in my project as well (the methods were not exposed for some reason). Thanks for the advice!