[solved][Matlab] Download entire take?

NatNet, VRPN, TrackD, and Plugins
Post Reply
zoltan
Posts: 9
Joined: Thu Sep 09, 2021 4:27 am

[solved][Matlab] Download entire take?

Post by zoltan »

Hi all,

I am using Matlab to access OptiTrack data, just started playing with the NatNet SDK. I can see how I can stream data, which is great to access real-time positions.

So the idea is, that, after connecting to the system and configuring the markers:
-I name the take
-I start recording
-I get the marker positions while recording
-I stop recording.
-Rinse, repeat :)

Now as far as I can tell, I can play back the recording, but it appears to be real-time: a 10 minute recording will take 10 minutes of streaming to download. I want to speed this up, because I won't have enough time to record all marker positions while recording and streaming.

How can I download the positions (ideally of the rigid bodies I want) of the entire recording?

If that's not possible, is there a file format description of the .TAK files? I can see it is some form XML, but it also contains binary data.


Z
Last edited by zoltan on Wed Sep 29, 2021 11:34 pm, edited 1 time in total.
zoltan
Posts: 9
Joined: Thu Sep 09, 2021 4:27 am

Re: [Matlab] Download entire take?

Post by zoltan »

(answering this for future me and maybe for a handful of people interested)

You can't instantly download the entire take with NatNet.

The closest equivalent you can do is to use the CSVExporter class in the NMotive API (link: https://v23.wiki.optitrack.com/index.ph ... _Processor).

You need to make a simple program to do the conversion to .csv either in C#, or IronPython, which is the result of C# bastardising Python.

Then, you can process the .csv file in whatever application you want.
zoltan
Posts: 9
Joined: Thu Sep 09, 2021 4:27 am

Re: [Matlab] Download entire take?

Post by zoltan »

Update #2.

I made a simple command line tool that allows the conversion of the .tak file to .csv.

Since I am working with rigid bodies only, I disabled most exporting features, but you can adapt the code to your liking very easily.

Either way, you can process the .csv file with any tool you want, and most importantly, you can create them without human interaction.

Here is the code.
https://github.com/ha5dzs/optitrack-mot ... -converter

Z
Post Reply