Get frame times for velocity computation

Post Reply
Posts: 1
Joined: Tue Sep 23, 2014 12:47 pm

Get frame times for velocity computation

Post by PietroPier » Tue Sep 23, 2014 1:02 pm

Hi everybody,

How do I get information about frame time when streaming rigid body data to Matlab. I need that for computing angular and linear velocity. Subtracting iFrame of consecutive frames will give me milliseconds gap between the two frames?



NaturalPoint Employee
NaturalPoint Employee
Posts: 199
Joined: Tue Jun 24, 2008 2:01 pm
Location: Corvallis, OR, USA

Re: Get frame times for velocity computation

Post by morgan » Thu Oct 02, 2014 10:41 am

The frame of mocap data structure exposed by the NatNet managed library (NatNetML) used by MATLAB contains a frame ID and a timestamp. The timestamp is a float, in seconds, representing the time the mocap data arrived at the host from the camera. I would use this for measuring the time delta between frames of data.

iFrame could also be used assuming you know the capture rate, which you can query to Motive from MATLAB using:

Code: Select all

       % Test - send command/request to Motive
        [byteArray, retCode] = theClient.SendMessageAndWait('FrameRate');
        if(retCode ==0)
            byteArray = uint8(byteArray);
            frameRate = typecast(byteArray,'single');

hope this helps,


Post Reply