Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Data from GRIP not available in Java Code (http://www.chiefdelphi.com/forums/showthread.php?t=142592)

moomoomoo309 26-01-2016 15:49

Data from GRIP not available in Java Code
 
I've been using a roboRIO and trying to get a Contour Report from GRIP into my code. GRIP works well enough; data comes from it and into the Network Table viewer (I can see all of the data in the Network Table Viewer!). Once I attempt to get the data from the NetworkTable into my code, it does not work.

What I've tried (in teleopPeriodic) given table=NetworkTable.getTable("GRIP/myCountoursReport")):
  • Printing out table.getKeys() (which is empty)
  • Checking if a given index (I.E area) exists (table.containsKey("area") was false)
  • Publishing a different number into the GRIP table and trying to get that (put the framerate into the table, NetworkTable.getTable("GRIP").getNumber("myNumber" ,Double.NaN) returns NaN)

Do you have any advice for how I can fix this problem, or any other diagnostic steps you may need?

ThomasClark 27-01-2016 12:43

Re: Data from GRIP not available in Java Code
 
Is OutlineViewer in client mode or server mode?

What is the NetworkTables server address in GRIP?

moomoomoo309 27-01-2016 14:35

Re: Data from GRIP not available in Java Code
 
The OutlineViewer is in client mode and the NetworkTables server address is roborio-224-frc.local. GRIP deploys fine, and the data is correct in the OutlineViewer, but I can't import any NetworkTables.

ThomasClark 27-01-2016 14:37

Re: Data from GRIP not available in Java Code
 
What is GRIP running on?

Can you share a screenshot of your pipeline?

moomoomoo309 27-01-2016 14:48

Re: Data from GRIP not available in Java Code
 
GRIP is running on a Windows 7 laptop, and here's the pipeline.


ThomasClark 27-01-2016 14:59

Re: Data from GRIP not available in Java Code
 
Everything seems OK from the GRIP side of things. Can you post a link to your full robot code?

moomoomoo309 27-01-2016 15:07

Re: Data from GRIP not available in Java Code
 
http://pastebin.com/8WrBNeK6

Here's the code. When I get the table, it always returns an empty one.

ThomasClark 27-01-2016 15:17

Re: Data from GRIP not available in Java Code
 
PHP Code:

table NetworkTable.getTable("GRIP/myCountoursReport"); 

should be


PHP Code:

table NetworkTable.getTable("GRIP/myContoursReport"); 


moomoomoo309 27-01-2016 15:26

Re: Data from GRIP not available in Java Code
 
Thank you, that fixed it. It's always the simple mistakes that get us.

On a side note, why did "NetworkTable.getTable("GRIP").getKeys()" return an empty set? Shouldn't it have "myContoursReport" in it?

ThomasClark 27-01-2016 15:28

Re: Data from GRIP not available in Java Code
 
getKeys() returns the set of values directly inside the GRIP table. I don't think it include subtables.

getSubTables() is probably what you're looking for.


All times are GMT -5. The time now is 07:25.

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