-
Notifications
You must be signed in to change notification settings - Fork 3
Description
My question is regarding Optitrack - Motive and NatNet SDK SampleClient.cpp script.
My goal is to capture the "time now" in UNIX on my NatNet machine, which is running on Ubuntu.
However, I’m having trouble figuring out where exactly to implement this in the SampleClient.cpp code. I’ve already added the following line using std::chrono to capture the current time in the Data handler:
const auto now = std::chrono::system_clock::now();
const std::time_t t_c = std::chrono::system_clock::to_time_t(now);
But I’m unsure if this should be placed inside the void NATNET_CALLCONV DataHandler(sFrameOfMocapData* data, void* pUserData) function or elsewhere. I also want to use the time_now in the OutputFrameQueueToConsole() function where the latencies, etc are printed, but I’m a bit confused on how to approach this since I’m not very comfortable with C++ code. (Running into errors accessing the variables etc)
printf("Server Timestamp : %s\n", std::ctime(&t_c));

Could you provide some guidance on where this logic should go? Thank you so much for your help.
