
04-03-2014, 13:44
|
|
Goldenchest
AKA: Gary Chien
 FRC #1758 (Technomancers)
Team Role: Programmer
|
|
Join Date: Dec 2012
Rookie Year: 2010
Location: United States
Posts: 17
|
|
|
Re: How does NetworkTables work?
Quote:
Originally Posted by Greg McKaskle
First, I'll give the bigger abstract answer, then I'll give a practical one.
Network Tables clients and servers are mostly the same. They store name/value pairs that the local program writes and return them when a read operation is performed. They support Booleans, double precision numbers, strings, and arrays of these types. The next feature of them is that multiple computer/robots/camera processors can be kept in synch. One of these is designated the server, and the rest are clients. They are much the same except that the server knows who everyone else is and replicates data out to keep everyone in synch. If we have three NT participants, S, C1, and C2, A variable change made on C1 is stored and sent to S. S then sends the new value to C2 as well.
In practice, the robot will typically be the server, the dashboard a client. Some teams will have an onboard processor which is a client. Some will also run NT on their programming laptop so that when it is connected, their tools can see the variables.
The NT clients are often the same code compiled for the DS laptop. However the only thing that matters is that they implement the protocol that shares. In reality, the clients and servers can be written in different languages and it won't affect things.
Greg McKaskle
|
Thanks! I'm still slightly unclear about the other part of my question though: how am I supposed to compile the client code? Should I make it into an exe and run it separately? Am I supposed to build it inside or outside of WindRiver? Once I build the client code for the driver station, when and how do I run it so that it will communicate with the robot?
|