Go to Post Calling all grandmas! We need 3000 crocheted ropes for team's! - Jon Stratis [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2016, 13:31
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Network Table Viewer / GRIP issue

Hello!

I'm trying to use the Network Table Viewer in server mode to display contour values from GRIP on my machine but whenever I try to start the Network Table Viewer in server mode using:

java -jar OutlineViewer.jar

and then use 127.0.0.1 as the host/address I get the following error:

platform: /Mac OS X/x86_64/
NT: ERROR: bind() failed: Address already in use (workspac:102)

The Network Table Viewer comes up but only display ">Root" which is empty.

The GRIP documentation states that the Network Table Viewer can be used in server mode to display values on my local machine.

Its there something else I need to do to get the Network Table Viewer working in server mode on my machine?

Thanks!

David
  #2   Spotlight this post!  
Unread 31-01-2016, 17:54
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: Network Table Viewer / GRIP issue

That error is printed out by OutlineViewer, not GRIP, right? Are you sure you're not running another instance of OutlineViewer?
__________________
GRIP (Graphically Represented Image Processing) - rapidly develop computer vision algorithms for FRC
  #3   Spotlight this post!  
Unread 01-02-2016, 07:57
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Re: Network Table Viewer / GRIP issue

Hi Thomas.

That's correct. The error is coming from the Outline Viewer and not GRIP. I do not seem to have this problem on Windows, only Mac. I do have FRCSim installed on the Mac but it is current not running.

David
  #4   Spotlight this post!  
Unread 01-02-2016, 09:26
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 148
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
It sounds like something else on your computer is using port 1735. You're going to have to track down what it is and shut that program down. StackOverflow has an article on how to list open ports: http://stackoverflow.com/questions/4...rt-on-mac-os-x.
  #5   Spotlight this post!  
Unread 01-02-2016, 17:10
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Re: Network Table Viewer / GRIP issue

I did a lsof -i:1735 which turned out to be a hung java process. Went to Activity Monitor and killed it.

Outline Viewer runs fine now - can view data from GRIP.

Thanks!

David
  #6   Spotlight this post!  
Unread 01-02-2016, 21:31
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Re: Network Table Viewer / GRIP issue

I'm trying to mock up some code to read the Network Table using the "desktop" package of networktables.jar, e.g., NetworkTables-3.0.0-20151121.170557-4-desktop-development.jar but I am not able to read values from the table. I'm running the Outline Viewer and can see the values there, but not in my own code.

NetworkTable table = NetworkTable.getTable("/GRIP/myContoursReport");
System.out.println(table.containsKey("area"));

Output:
platform: /Mac OS X/x86_64/
false

Is there anything special I need to do in my client code to initialize NetworkTable?

Thanks!

David
  #7   Spotlight this post!  
Unread 01-02-2016, 23:12
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: Network Table Viewer / GRIP issue

I think you need to leave out the leading slash.

PHP Code:
NetworkTable table NetworkTable.getTable("GRIP/myContoursReport"); 
__________________
GRIP (Graphically Represented Image Processing) - rapidly develop computer vision algorithms for FRC
  #8   Spotlight this post!  
Unread 02-02-2016, 03:10
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 268
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: Network Table Viewer / GRIP issue

Quote:
Originally Posted by dszlucha View Post
I'm trying to mock up some code to read the Network Table using the "desktop" package of networktables.jar, e.g., NetworkTables-3.0.0-20151121.170557-4-desktop-development.jar
Quote:
Originally Posted by ThomasClark View Post
I think you need to leave out the leading slash.

PHP Code:
NetworkTable table NetworkTable.getTable("GRIP/myContoursReport"); 
Yes, that should fix it. This has been fixed in the latest release, but David is using 20151121 rather than the latest release (David, I also recommend you upgrade with the latest version from http://first.wpi.edu/FRC/roborio/mav....0.0-SNAPSHOT/ .. as of this writing it's 20160115).
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
  #9   Spotlight this post!  
Unread 02-02-2016, 16:58
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Re: Network Table Viewer / GRIP issue

Thanks Thomas and Peter for the replies.

I grabbed the latest networkltables jar: NetworkTables-3.0.0-20160115.192917-3-desktop.jar, started up the outline viewer choosing localhost and server, fired up GRIP and could see the Contours report being published via the outline viewer:
/Root/GRIP/myContoursReport/area etc...

But then had the same result in my java code with the addition of an additional error:

Code is in main():

NetworkTable table = NetworkTable.getTable("GRIP/myContoursReport");
System.out.println(table);
System.out.println(table.containsKey("area"));

Output is:

platform: /Mac OS X/x86_64/
NetworkTable: /GRIP/myContoursReport
false
NT: ERROR: bind() failed: Address already in use (workspac:102)

If I put back the old networktables jar the error goes away but I still can't read data from the network table.

David
  #10   Spotlight this post!  
Unread 02-02-2016, 18:08
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 148
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
What code are you using for setup? Are you putting ntcore into client mode, and set up the team correctly? Relevant documentation is here: http://first.wpi.edu/FRC/roborio/rel...workTable.html.
  #11   Spotlight this post!  
Unread 02-02-2016, 18:28
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Re: Network Table Viewer / GRIP issue

Hi Fred.

I've added NetworkTable.setClientMode() as well as NetworkTable.setTeam(1518) to my code and verified that GRIP is set to team 1518 as well. I've also switched back to a Windows box which also has the "desktop" build of networktables.jar but I'm still not reading from the table:

NetworkTable.setClientMode();
NetworkTable.setTeam(1518);
NetworkTable table = NetworkTable.getTable("GRIP/myContoursReport");
System.out.println(table);
System.out.println(table.containsKey("area"));

Output:
platform: /Windows/amd64/
NetworkTable: /GRIP/myContoursReport
false
  #12   Spotlight this post!  
Unread 02-02-2016, 18:54
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 148
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
David, you'll need to set the ip to wherever you're actually running the NetworkTables server. It looks like you're not running a robot currently, but using OutlineViewer as the server, right? If that's the case, you'll want to point NetworkTables at 127.0.0.1, not call setTeam.
  #13   Spotlight this post!  
Unread 02-02-2016, 19:09
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Re: Network Table Viewer / GRIP issue

I appreciate the help but unfortunately it's still not working in "desktop" mode, e.g., not on RoboRIO after setting IP address, e.g., NetworkTable.setIpAddress(), setting client mode and not setting team.

Running Outline Viewer in "server" mode, IP 127.0.0.1. Running GRIP and can see contour values in Outline Viewer. Running the following code in main():

NetworkTable.setIPAddress("127.0.0.1");
NetworkTable.setClientMode();
//NetworkTable.setTeam(1518);
NetworkTable table = NetworkTable.getTable("GRIP/myContoursReport");
System.out.println(table);
System.out.println(table.containsKey("area"));

Output:
platform: /Mac OS X/x86_64/
NetworkTable: /GRIP/myContoursReport
false
  #14   Spotlight this post!  
Unread 02-02-2016, 19:45
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 268
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: Network Table Viewer / GRIP issue

Can you post your full program? Is your posted code running in some kind of loop so NT actually has time to connect? Note all the NT calls are non-blocking so if your main() code just simply runs these statements and exits it probably never even had a chance to connect. NT will print "CONNECTED" when it successfully connects to the server.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)

Last edited by Peter Johnson : 02-02-2016 at 19:56.
  #15   Spotlight this post!  
Unread 02-02-2016, 20:39
dszlucha dszlucha is offline
Registered User
FRC #1518 (Raider Robotics)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2016
Location: Rochester, NY
Posts: 12
dszlucha is an unknown quantity at this point
Re: Network Table Viewer / GRIP issue

I was just printing out values once in main(). I added a loop and a delay and now see the "NT connected" message and can now read values from the network table.

Thanks for the help!

David
Closed Thread


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 01:30.

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