Our team is experimenting with an off season robot and wants to send a camera image from a co-processor to the LabVIEW Driver station. No one on the team is familiar with the ntcore or the NetworkTable libraries in C++.
We know that the libraries and the .dll is installed correctly and is working from testing.
#include <opencv2\videoio.hpp>
#include <opencv2\highgui.hpp>
#include <opencv2\opencv.hpp>
#include <ntcore.h>
#include <networktables/NetworkTable.h>
using namespace cv;
using namespace std;
using std::shared_ptr;
void main()
{
NetworkTable::SetServerMode();
NetworkTable::SetIPAddress("10.74.32.11"); //ip address of co-processor
NetworkTable::Initialize();
shared_ptr<NetworkTable> myTable = NetworkTable::GetTable("SmartDashboard");
... //code for grabbing image and manipulating it
cv::Size size = dst.size();
int total = size.width * size.height * dst.channels();
std::vector<uchar> data(dst.ptr(), dst.ptr() + total);
std::string s(data.begin(), data.end());
myTable->PutString("Eagle_Eye", s);
}
Our question is what is the proper way to set up the network tables with a LabVIEW dashboard to send the compressed string s to the network tables.
RoboRio IP 10.74.32.2
Co-Processor IP 10.74.32.11
Driver Station IP 10.74.32.5