Page 1 of 1

Accessing real time data with Matlab and .NET

Posted: Fri Oct 15, 2010 6:27 am
by barneygumble
Dear all,

I'm trying to access the Optitrack datas using NatNetML.dll.
First, I take the necessary file in the System folder of Windows, and I load the library under Matlab (R2009b) with the following command:
Opti = NET.addAssembly([mypath '\NatNetML.dll']);

It works. After, I have to create a client objet with the constructor, equivalent to the following C command:

theClient = new NatNetClient(iConnectionType);

In matlab, the NatNetClient class does not exist, I only have NatNetClientML. I try to use the NatNetClientML class as following:

theClient = NatNetML.NatNetClientML
(and various other methods with or without optionnal arguments, different syntax, etc... This syntax works with other .dll that I use for other systems)

It results in an error message ("An external components thread an exception"), and I can't create any object to interact with the server.

Please, can someone give us the few code that allow to create a client object with Matlab? We are many people interested!

Many thanks,

Etienne

Re: Accessing real time data with Matlab and .NET

Posted: Mon Nov 15, 2010 5:52 am
by barneygumble
What about the total lack of response? Does it signify that the NatNetML doesn't work with Matlab? Please, can the NaturalPoint developers check this point?

Re: Accessing real time data with Matlab and .NET

Posted: Mon Nov 15, 2010 3:40 pm
by VincentG
The MatLab plugin was created by a customer and was not developed by NaturalPoint.

Please see :
http://forum.naturalpoint.com/forum/ubb ... #Post42783

Re: Accessing real time data with Matlab and .NET

Posted: Tue Nov 16, 2010 8:20 am
by barneygumble
Easy and works fine for me, good!

Re: Accessing real time data with Matlab and .NET

Posted: Mon Feb 06, 2012 11:25 am
by heath789
Hello,

I am trying to do the same project, adapting the C# code to Matlab. I am using Arena and the solution given is to allow the user to use the TT API to control Tracking Tools from Matlab.

Is there another solution that might help me establish a client so that Matlab can read in live data from Arena via .NET? I am having trouble translating the C# code given in the example to Matlab; establishing a client and using the assembly to receive streamed data.

Re: Accessing real time data with Matlab and .NET

Posted: Mon Feb 06, 2012 2:16 pm
by NaturalPoint - Mike
Hello -

You can use the NatNet SDK and stream from arena to Matlab. There are two methods of doing this. First, you can use the SDK directly to make a client to accept the streaming from Arena. Alternatively, you can use a direct depacket method to listen to the stream and pull the information directly from it. Both methods are shown in the example code, and should be relatively easy to implement.