Get frame times for velocity computation

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

Get frame times for velocity computation

Post 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.
morgan
NaturalPoint Employee
NaturalPoint Employee
Posts: 199
Joined: Tue Jun 24, 2008 2:01 pm
Location: Corvallis, OR, USA
Contact:

Re: Get frame times for velocity computation

Post 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
Post Reply