Page 1 of 1

Time stamp of frames

Posted: Sun Aug 16, 2009 3:35 pm
by oschnit
My colleges and I are using the Tracking tools API in a C++ program for the purpose of tracking rigid bodies. For calculating the time rate of change of the location and orientation we need to know the time in which each frame was taken (Real time).
What is the difference between the functions "TT_Update()" and "TT_UpdateSingal frame"?
What does the function "FrameTimeStamp" return (This function appears in the header file but not in the manual..).


Ory Schnitzer

Re: Time stamp of frames

Posted: Mon Aug 17, 2009 10:37 am
by beckdo
If you want to make sure to have access to every incoming frame of data you'll want to call TT_UpdateSingleFrame(). Make sure you're calling that more often than every 10 milliseconds. If you're not concerned with accessing every incoming frame of data or call the function slower than 10 milliseconds use TT_Update(). This will process all outstanding frames in a single call leaving you with access to the latest incoming frame.

FrameTimeStamp uses the operating system as the global time authority and stamps each incoming frame group with a value from the operating system (in seconds).

Re: Time stamp of frames

Posted: Tue Aug 18, 2009 12:51 am
by oschnit
Thanks for the quick answer!

Our main program consists of a main loop in which two objectives must be met.
One, a real-time calculation (based on an incoming frame data) that takes about 7-8 milliseconds. Second: allowing Tracking Tools to calculate the newest frame data.
When you say we should call the cameras more often than 10 millisec, do you mean that we should allow 10 millisec Run-Time exclusively to Tracking Tools, or is it sufficient to perform our calculation and then just call TT_UpdateSingalFrame(), and end the loop?



Re: Time stamp of frames

Posted: Tue Aug 18, 2009 12:22 pm
by beckdo
When you call TT_UpdateSingleFrame() or TT_Update() you can measure the total amount of time those methods take, and you'll find they execute very quickly. That time is the total amount of processing and calculation overhead, all other calls into the Tracking Tools API are just for accessing data so they don't take any appreciable time to execute.

The key thing to note is that frame groups are coming in from the cameras every 10 milliseconds. So if you want to keep up with the data you need to either call TT_Update(), which will process all outstanding data, or call TT_UpdateSingleFrame() more often than every 10 milliseconds to make sure you don't get behind the incoming frame rate from the cameras which would result in unwanted latency between the physical tracked object and the data you're processing.