Main Page → Documentation Reference Guide
Page Scope
The OptiTrack systems combine state of art technologies to provide swift processing of captured frame data in order to accomplish 3D tracking in real-time. However, minimal processing latencies are inevitably introduced throughout processing pipelines. For timing-sensitive applications, these latency metrics can be monitored from the Status Panel of Motive or in the NatNet streaming protocol.
This is available only in NatNet version 3.0 or above
Exemplary latency calculations are demonstrated in the SampleClient project and the WinFormSample project. Please refer to these sources to find more about how these latency values are derived.
In NatNet 3.0, new data types have been introduced to allow users to monitor measured timestamps from specific points in the pipeline. From sFrameOfMocapData received in the NatNet client applications, the following timestamps can be obtained:
These timestamps are reported in “ticks” that are provided by the host computer clock. When computing latencies, you need to divide the timestamp values by the clock frequency in order to obtain the time values in seconds. The clock frequency is included in the server description packet: sServerDescriptionPacket::HighResClockFrequency. To calculate the time that has elapsed since a specific timestamp, you can simply call the NatNetClient::SecondsSinceHostTimestamp method, passing the desired timestamp as its input. Using clock synchronization between the client and server, this will return the time in seconds since the corresponding timestamp.
const bool bSystemLatencyAvailable = data->CameraMidExposureTimestamp != 0; // From SampleClient.cpp (522 ~ 531) if ( bSystemLatencyAvailable ) { const uint64_t systemLatencyHostTicks = data->TransmitTimestamp - data->CameraMidExposureTimestamp; const double systemLatencyMillisec = (systemLatencyHostTicks * 1000) / static_cast<double>(g_serverDescription.HighResClockFrequency); }
System Latency may not always be available for all system configurations. Thus, it is suggested to enclose this calculation within a conditional statement.
// From SampleClient.cpp (502~503) const uint64_t softwareLatencyHostTicks = data->TransmitTimestamp - data->CameraDataReceivedTimestamp; const double softwareLatencyMillisec = (softwareLatencyHostTicks * 1000) / static_cast<double>(g_serverDescription.HighResClockFrequency);
In the older versions of NatNet, the software latency was roughly estimated and reported as fLatency data, which is now deprecated. The derived software latency described in this can be used to replace the fLatency values.
// From SampleClient.cpp (507) const double transitLatencyMillisec = pClient->SecondsSinceHostTimestamp( data->TransmitTimestamp ) * 1000.0;
// Sample code const bool bSystemLatencyAvailable = data->CameraMidExposureTimestamp != 0; if ( bSystemLatencyAvailable ) { const double clientLatencyMillisec = pClient->SecondsSinceHostTimestamp(data->CameraMidExposureTimestamp) * 1000.0; }
In previous versions of Motive (prior to 2.0), the only reported latency metric was the software latency. This was an estimation of the software latency derived from the sum of the processing times taken from each of the individual solvers in Motive. The latency calculation in Motive 2.0 is a more accurate representation and will be slightly larger by comparison than the latency reported in the older versions.
› Q : Latency increases when playing media applications on the host PC
A: When playing media files using applications such as Chrome or VLC, you may experience increased system latency in Motive. This is due to Window's Multimedia Class Scheduler Service (MMCSS). The MMCSS will prioritize CPU resources to these time-sensitive media applications over other applications including Motive. This may cause increased system latency and dropped frames in Motive. We recommend closing media applications if there are any issues with system latency and dropped frames.