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
Or Hirshfeld (2020). NatNet (Motive/Arena) simple sample for location data by Or Hirshfeld (https://www.mathworks.com/matlabcentral/fileexchange/48279-natnet-motive-arena-simple-sample-for-location-data-by-or-hirshfeld), MATLAB Central File Exchange. Retrieved .
When I try to obtain data from the OptiTrack system to MATLAB I end up with empty data packs, although when I use different samples I am able to receive data.
Using this, I am getting the error of Struct contents reference from a non-struct array object, when using the quaternion, how to solve this issue?
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.
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?
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
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
Added html of the code
Inspired by: Tracking Tools (Optitrack)
Inspired: Trackable Location (Mocap) from Optitrack Tracking Tools to Simulink by Or Hirshfeld in Technion, Natural Point Motive (Optitrack) API interface to Matlab and Simulink 64bit by Or Hirshfeld, C-mex S-function interface to Natural Point Motive (Optitrack) in Simulink by Or Hirshfeld, orhirshfeld/Simulink_Motive_API_v3