|
Re: NetworkTable : Tables, SubTables
It seems like--in Java, at least--the tables are simply hash tables with buckets. Each bucket can contain any type of data..eg double, boolean, or even another NetworkTable. So adding a subtable in Java looks like:
NetworkTable add = new NetworkTable();
NetworkTable.getTable("main").putSubTable("aSubTab le", add);
We have gotten errors if we try to access a subtable that we have not created yet.
NetworkTable.getTable("main").getSubTable("camera" ).putDouble("x", 40);
//does not work, unless you have put the "camera" subtable into the main table previously
Again, we are using Java, so it may be implemented somewhat differently in C++. Hope that helps, though.
|