Page 1 of 1

Get frame times for velocity computation

Posted: Tue Sep 23, 2014 1:02 pm
by PietroPier
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?

Thanks,

Pietro.

Re: Get frame times for velocity computation

Posted: Thu Oct 02, 2014 10:41 am
by morgan
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');
        end

hope this helps,

Morgan