File Exchange

image thumbnail

NatNet (Motive/Arena) simple sample for location data by Or Hirshfeld

version 1.2 (21.7 KB) by

a Simple Sample to transfer Mocap data from Motive/Arena to Matlab using NatNet stream

6 Downloads

Updated

View License

It took me time to understand the sample including in NateNet SDK and the only thing i required from it is to get current data. so after many hours of trails and errors I wish to help fellow programmer that would need to handle this task.
please acknowledge me if you use this code

Comments and Ratings (4)

KIDUS guys

Hey, I am very new to Motive, Natnet. Is there anyone that can explain to me about Natnet and how to use it may be show me the step to follow.
Thanks

Bao Kang Hee

Hi,
Same as you, I would require current data from motive. However, I need the location of a rigid body (x,y and z) and I have modified the code but it seem to be wrong somewhere.

rigidBodyData = frameOfData.RigidBodies(1);
xVals = rigidBodyData.x;

The above line returns me an error "Struct contents reference from a non-struct array object."

Anybody can help me on this?

Or Hirshfeld

Hi Tony
I'm glad to hear you are trying my work
try to check how the streaming is set in Motive/Arena on the server computer
first check that it active.
it's also should indicate which ip it use for broadcast.
maybe you have few net adapters, try to find the right ip that you use for connecting.

also try to test run it on the same computer while the streaming

Tony Pham

Hi Or Hirshfeld! I try to run your Matlab code on a client computer to connect to a server on which the Optitrack is running. I change the HostIP to the server's IP, but the return value of the function theClient.Initialize(HostIP, HostIP) is 3 which is not successful. So what is the possible reason? I used to use Visual C++, and it worked well. The matlab version I am using is R2013b. Thank you

Updates

1.2

updating toolbox

1.1

Added html of the code

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today