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?

Is OutlineViewer in client mode or server mode?

What is the NetworkTables server address in GRIP?

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.

What is GRIP running on?

Can you share a screenshot of your pipeline?

GRIP is running on a Windows 7 laptop, and here’s the pipeline.

Imgur

Everything seems OK from the GRIP side of things. Can you post a link to your full robot code?

http://pastebin.com/8WrBNeK6

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

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

should be

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

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?

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.