Go to Post [Goals For 2012] 1. Build on 20 years of hard work. 2. Inspire a new generation so they come back another year. 3. Repeat. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2014, 17:17
Peragore's Avatar
Peragore Peragore is offline
CEO of Black Magic
AKA: Philip Mulford
FRC #3373 (Team Robohawk)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: US
Posts: 50
Peragore is an unknown quantity at this point
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?
__________________


Code:
 
while (life){
  frcObsession = true;
  obs.ProgramAndObsess();
}
if (!life) life = true;
Reply With Quote
  #2   Spotlight this post!  
Unread 07-02-2014, 01:15
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
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
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2014, 08:12
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Building Custom WPILib

Wouldn't it just be easier to create your own stringReplace? (if thats the only regex you use)
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2014, 15:43
Peragore's Avatar
Peragore Peragore is offline
CEO of Black Magic
AKA: Philip Mulford
FRC #3373 (Team Robohawk)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: US
Posts: 50
Peragore is an unknown quantity at this point
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
__________________


Code:
 
while (life){
  frcObsession = true;
  obs.ProgramAndObsess();
}
if (!life) life = true;
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2014, 21:51
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
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'.

Last edited by Joe Ross : 07-02-2014 at 22:06.
Reply With Quote
  #6   Spotlight this post!  
Unread 08-02-2014, 13:51
Peragore's Avatar
Peragore Peragore is offline
CEO of Black Magic
AKA: Philip Mulford
FRC #3373 (Team Robohawk)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: US
Posts: 50
Peragore is an unknown quantity at this point
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!
__________________


Code:
 
while (life){
  frcObsession = true;
  obs.ProgramAndObsess();
}
if (!life) life = true;
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:32.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi