I have not found any documentation on how NetworkTables2 works. I’ve been trying to understand it from the source, but the architecture is a bit too enterprise-y to wrap my head around. Does anyone know how I would implement a client on an on-board raspberry pi and a server on the cRIO?
Does this help at all? http://wpilib.screenstepslive.com/s/3120/m/7912/l/80205-writing-a-simple-networktables-program-in-c-and-java-with-a-java-client-pc-side
As far as I can tell, that documentation is for the old implementation of NetworkTables. And even that documentation is severely lacking.
I wrote the LV implementation from the protocol specification and while it isn’t complicated, I’ll agree that it isn’t trivial either. It would be far easier to use one of the client implementations already written and port it to RPI.
If you have specific questions I can probably answer them, and people like WPI students who have also written clients and servers are on this forum too.
Greg McKaskle
I honestly don’t think it would be that difficult to modify the vanilla wpilib implementation to run on the rpi. My problem is just understanding what that implementation is really supposed to be doing. I don’t understand how they intend users to interface with it at all.
For example, I would expect that to create a client, one would have to make an instance of the NetworkTableClient class. But that constructor takes an IOStreamFactory, a NetworkTableEntryTypeManager, and an NTThreadManager as arguments. I don’t know what those even do, much less how to obtain them.
Are you looking to do this in C++ or Java. I googled IOStreamFactory and found that it is a Java stream class. I didn’t google the others, but this is how I’d go about porting it.
Greg McKaskle
I’m working in C++. And it is definitely a C++ class as well, it’s just one made up entirely by the WPILib developers, as far as I can tell.
I’ve been using the NetworkTable class. It’s just a wrapper around the NetworkTables2 class… pretty simple to use in comparison. The SmartDashboard implementation uses the NetworkTable class underneath the hood too, so that’s probably the way to go. Just watch out for NULL pointers…
You can checkout the full networktables source here. http://firstforge.wpi.edu/sf/go/projects.network_tables_2_0/scm The project is built such that it should build on linux. I built it on ubuntu so that I could do debugging and profiling easier. The intended interface was through the NetworkTable class as virtuald said. The networktables2 classes were designed for much more advanced applications and allow for much more advanced applications. The example described here (http://wpilib.screenstepslive.com/s/3120/m/7912/l/80205-writing-a-simple-networktables-program-in-c-and-java-with-a-java-client-pc-side) should be easily ported to run on c++.
Also, if anyone is having issues with networktables2, I have a wireshark dissector for it here: https://bitbucket.org/byteit101/frc-wireshark-utils