![]() |
Building Custom WPILib
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? |
Re: Building Custom WPILib
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/...ib-source-code |
Re: Building Custom WPILib
Wouldn't it just be easier to create your own stringReplace? (if thats the only regex you use)
|
Re: Building Custom WPILib
The problem I am running into is the fact that String.replaceAll and String.Replace relies on regex, which WPILib doesn't have
|
Re: Building Custom WPILib
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'. |
Re: Building Custom WPILib
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!
|
| All times are GMT -5. The time now is 09:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi