Timestamp & Latency NatNet

NatNet, VRPN, TrackD, and Plugins
Post Reply
UHRaf
Posts: 1
Joined: Tue Mar 24, 2015 11:16 am

Timestamp & Latency NatNet

Post by UHRaf »

Hi,

We are using NatNet 2.7 and want to get an idea of the latency that is related with every packet that we receive. We don't have an eSync hub so I guess we cannot use the TimeCodes.

To test out the Timestamp and Latency information that are in the NatNet packets, we simply logged the timestamp + latency information when the dataCallback is called. We also observed the time interval in between every call of the dataCallback function.

This is a sample of what we log:

Time between previous call (ms): 10
Timestamp : 47108.39
Latency : 47108.39
---------------------------------------------------
Time between previous call (ms): 0
Timestamp : 47108.40
Latency : 47108.40
---------------------------------------------------
Time between previous call (ms): 10
Timestamp : 47108.41
Latency : 47108.41
---------------------------------------------------
Time between previous call (ms): 10
Timestamp : 47108.42
Latency : 47108.42
---------------------------------------------------
Time between previous call (ms): 10
Timestamp : 47108.43
Latency : 47108.43
---------------------------------------------------
Time between previous call (ms): 10
Timestamp : 47108.43
Latency : 47108.43
---------------------------------------------------
Time between previous call (ms): 0
Timestamp : 47108.44
Latency : 47108.44
---------------------------------------------------
Time between previous call (ms): 10
Timestamp : 47108.45
Latency : 47108.45
---------------------------------------------------

I don't get the meaning (unit) of the timstamp and latency information. 10 milliseconds passed by and the Timestamp is incremented with 0.01? In most of the cases the latency information is the same as the timestamp, sometimes it differs by 1 from the timestamp.

In other posts I found that the timestamp is the absolute timestamp related to the frame. But still the unit does not make sense to me. Normally timestamps should be in milliseconds.

Also the strange thing is that in many cases 10ms are in between callback functions. Sometimes however (as you can see from the sample data), there are 0 milliseconds in between the calls. Strangely enough, if I look at the position data of a rigidbody it changed e.g. 1.0cm (fast moving object).

Thanks in advance.
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 720
Joined: Mon Jan 19, 2015 11:52 am

Re: Timestamp & Latency NatNet

Post by steven.andrews »

Hello UHRaf,

The TimeStamp is a derived value from the frame ID and the frame period, and is represented as seconds, so a delta between two frames of 0.01 seconds = 10 milliseconds, which would be correct if you are running at 100 FPS.

fLatency is a legacy value and has been deprecated and should not be used. It is left in for compatibility with older NatNet clients.

Regarding the 0 ms between calls, this is likely due to the resolution of the default timer objects in MS Windows, which is typically 15 ms. Please refer to the NatNet SDK TimingClient sample, which includes measuring packet arrival using the MS Windows high resolution QueryPerforamnceCounter timer, which will provide sub-millisecond accuracy.

I hope this information points you in the right direction.

Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
Post Reply