Finding Corners with Limelight C++

Anyone have a code snippet in C++ of how to retrieve the cornx & corny values from the Limelight. We’ve passed every combination we can think of arrays and pointers to the Get function, but just keep getting “0s” back. We found a posted Java snippet, but haven’t successfully converted the code. Many thanks.

I think your snippet should look something like this:
I’m just grabbing that snippet from the API documentation. Also be sure that you’ve enabled the “send contours” option in the “Output” tab.

tcornx/tcorny appear to be arrays. So, the Get number function doesn’t seem to work. We’ve tried the GetArray and GetEntry functions, but can’t seem to get the syntax correct.

NetworkTableInstance inst = nt::NetworkTableInstance::GetDefault();
std::shared_ptr<NetworkTable> table = inst.GetTable("limelight");
NetworkTableEntry entry = table->GetEntry("tcornx");
std::vector<double> values = entry.GetDoubleArray({});

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.