Accessing real time data with Matlab and .NET

NatNet, VRPN, TrackD, and Plugins
Post Reply
barneygumble
Posts: 10
Joined: Wed Oct 14, 2009 2:28 am
Location: France, Bordeaux

Accessing real time data with Matlab and .NET

Post by barneygumble » Fri Oct 15, 2010 6:27 am

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

barneygumble
Posts: 10
Joined: Wed Oct 14, 2009 2:28 am
Location: France, Bordeaux

Re: Accessing real time data with Matlab and .NET

Post by barneygumble » Mon Nov 15, 2010 5:52 am

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?

VincentG
Posts: 7728
Joined: Mon Jul 17, 2006 5:00 am
Location: Corvallis, Oregon

Re: Accessing real time data with Matlab and .NET

Post by VincentG » Mon Nov 15, 2010 3:40 pm

The MatLab plugin was created by a customer and was not developed by NaturalPoint.

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

barneygumble
Posts: 10
Joined: Wed Oct 14, 2009 2:28 am
Location: France, Bordeaux

Re: Accessing real time data with Matlab and .NET

Post by barneygumble » Tue Nov 16, 2010 8:20 am

Easy and works fine for me, good!

heath789
Posts: 41
Joined: Wed Aug 10, 2011 7:42 am

Re: Accessing real time data with Matlab and .NET

Post by heath789 » Mon Feb 06, 2012 11:25 am

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.

NaturalPoint - Mike
Posts: 1896
Joined: Tue Feb 01, 2011 8:41 am
Location: Corvallis, OR

Re: Accessing real time data with Matlab and .NET

Post by NaturalPoint - Mike » Mon Feb 06, 2012 2:16 pm

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.

Post Reply