Go to Post Some people use Autodesk, some SolidWorks, some Pro-E, but 772 rose to the call of an unconventional CAD language, Minecraft. - Walter Deitzler [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 13-01-2013, 20:22
Fifthparallel Fifthparallel is offline
Registered User
AKA: Sam Chen
FRC #1410
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Denver, CO
Posts: 65
Fifthparallel is an unknown quantity at this point
Can somebody give me a run-down on NetworkTables connections?

I've looked over the NetworkTables2 headers in the C++ distrib. of the WPILib.

A couple questions:

1. Can I just set a listen on a port so I can utilize other networking libraries, like socket.io?

2. Following the above, does NetworkTables require a client-server relationship? That is, does the client have to establish a connection with a server written in NetworkTables? Or could it be something else?
__________________
sudo chmod u+x helloworld.sh
gotta start somewhere.
  #2   Spotlight this post!  
Unread 13-01-2013, 20:47
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Can somebody give me a run-down on NetworkTables connections?

If I understand the question correctly, the robot is treated as the server and everything else (programming laptops, driver station, onboard imaging processors) are called clients. The primary difference is that the server unions all of the client variables with its own and assigning Field IDs for various names of variables. Also, race conditions let the server win, and clients do not talk to each other but to the server. The implementation of client and server is actually quite similar otherwise.

Greg McKaskle
  #3   Spotlight this post!  
Unread 13-01-2013, 21:10
Fifthparallel Fifthparallel is offline
Registered User
AKA: Sam Chen
FRC #1410
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Denver, CO
Posts: 65
Fifthparallel is an unknown quantity at this point
Re: Can somebody give me a run-down on NetworkTables connections?

My real question is whether I could use Javascript with something like socket.io to send information to and from the robot using Network Tables. That is, have a NT Server running on the robot with various clients using other communications libraries on other networked devices to send and receive information.

Libraries like NT, socket.io, and websockets all have their own way of handling servers and clients. Can I mess with them so that I can open a connection from a websockets client to receive data from a NT server node on the cRio?
__________________
sudo chmod u+x helloworld.sh
gotta start somewhere.
  #4   Spotlight this post!  
Unread 13-01-2013, 21:25
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Can somebody give me a run-down on NetworkTables connections?

Those higher level protocols are typically based on TCP. You can use those on the client, but you may need to use a lower level TCP API on the robot. I am not that familiar with the libraries/protocols you list, so perhaps others are familiar with them on the cRIO.

Greg McKaskle
  #5   Spotlight this post!  
Unread 13-01-2013, 21:33
Fifthparallel Fifthparallel is offline
Registered User
AKA: Sam Chen
FRC #1410
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Denver, CO
Posts: 65
Fifthparallel is an unknown quantity at this point
Re: Can somebody give me a run-down on NetworkTables connections?

After looking at the LV default robot code and dashboard projects, it looks like a server is instantiated, and then sends/reads Key:Value pairs in a table. The NT Server listens on a specified TCP/IP port, and the Client creates a TCP connection to some IP address and a specified port.

So then, how does that implementation work? Is there anything I missed that might be crucial to using something else?
__________________
sudo chmod u+x helloworld.sh
gotta start somewhere.
  #6   Spotlight this post!  
Unread 13-01-2013, 22:02
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Can somebody give me a run-down on NetworkTables connections?

I think the protocol you are describing is called Network Tables. It isn't too complicated, but includes a notion of a sequence number to arbitrate simultaneous updates and it includes a bootstrapping mechanism for getting all of the variables duplicated across clients and servers.

Greg McKaskle
  #7   Spotlight this post!  
Unread 13-01-2013, 22:20
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 992
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Can somebody give me a run-down on NetworkTables connections?

I found A description of the Network Tables 2.0 spec on the WPILib project: http://firstforge.wpi.edu/sf/docman/...ib/docman.root
  #8   Spotlight this post!  
Unread 13-01-2013, 23:05
Fifthparallel Fifthparallel is offline
Registered User
AKA: Sam Chen
FRC #1410
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Denver, CO
Posts: 65
Fifthparallel is an unknown quantity at this point
Re: Can somebody give me a run-down on NetworkTables connections?

Thanks a ton for the help guys!
__________________
sudo chmod u+x helloworld.sh
gotta start somewhere.
  #9   Spotlight this post!  
Unread 14-01-2013, 19:01
calica calica is offline
Registered User
FRC #2471
 
Join Date: Jan 2011
Location: Camas, WA
Posts: 9
calica is an unknown quantity at this point
Re: Can somebody give me a run-down on NetworkTables connections?

Does anyone know where the current NetworkTables code for JavaSE is located? FirstForge has a Network Tables 2.0 project but the latest file release is from July 2012. We've tried that code but changes aren't being seen on the cRIO.

Want to make sure it should work before spending a lot of time debugging.
  #10   Spotlight this post!  
Unread 14-01-2013, 19:53
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,600
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: Can somebody give me a run-down on NetworkTables connections?

it's included in the java plugins. See C:\Users\<username>\sunspotfrcsdk\desktop-lib
  #11   Spotlight this post!  
Unread 14-01-2013, 20:47
calica calica is offline
Registered User
FRC #2471
 
Join Date: Jan 2011
Location: Camas, WA
Posts: 9
calica is an unknown quantity at this point
Thanks. Will give that a try tonight and report back.
  #12   Spotlight this post!  
Unread 15-01-2013, 00:34
calica calica is offline
Registered User
FRC #2471
 
Join Date: Jan 2011
Location: Camas, WA
Posts: 9
calica is an unknown quantity at this point
Just spent the evening wrestling with this. Finally tracked the problem to the desktop lib defaulting to server mode. There doesn't seem to be a method to switch to client mode. Just recompiled the JAR with NetworkTable.java line 39 changed. It works great now.
  #13   Spotlight this post!  
Unread 15-01-2013, 00:35
calica calica is offline
Registered User
FRC #2471
 
Join Date: Jan 2011
Location: Camas, WA
Posts: 9
calica is an unknown quantity at this point
What's the best place to report this issue? Firstforge, but NetworkTables or WPILib?
  #14   Spotlight this post!  
Unread 15-01-2013, 09:58
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: Can somebody give me a run-down on NetworkTables connections?

Report it in the NetworkTables project. This should be fixed in the next update.
  #15   Spotlight this post!  
Unread 15-01-2013, 17:19
calica calica is offline
Registered User
FRC #2471
 
Join Date: Jan 2011
Location: Camas, WA
Posts: 9
calica is an unknown quantity at this point
Re: Can somebody give me a run-down on NetworkTables connections?

Posted to WPILib Java tracker. NetworkTables 2.0 project doesn't give me the option to post new issues.
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 02:23.

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