Network Table & Entry Initialization

How do I initialize NetworkTables and NetworkTable Entries in the .cpp files? I’m trying to use tables generated by ChameleonVision. Thanks

One example from the docs (this one is with GRIP, but the concept is generic): https://docs.wpilib.org/en/latest/docs/software/vision-processing/grip/reading-array-values-published-by-networktables.html

The basic concept is:

auto table = nt::NetworkTable::GetTable("MyTable");
nt::NetworkTableEntry entry = table->GetEntry("value");
...
double value = entry.GetDouble(0);

How do I do it to a subtable?

You can either put the subtable name in the GetTable string (e.g. "MyTable/MySubTable") or call GetSubTable on the Table (e.g. auto subTable = table->GetSubTable("MySubTable")).