File Exchange

image thumbnail

Optitrack SDK interface demo

version 1.1 (2.15 KB) by

Demonstration file on how to interface directly with Natural Points USB cameras (TrackIR or FLEX)

4 Downloads

Updated

View License

% optitrack_data()
%
% This function demonstrates basic functionality of Optitrack SDK for
% communicating with Natural Point cameras. This has been specifically
% designed to work with the TrackIR4 camera (a small USB camera for
% tracking objects). The camera must be plugged in and device drivers
% installed. This should also work for the Optitrack cameras (FLEX).
%
% Written by Glen Lichtwark, University of Queensland, Australia
% Last updated: 22nd Jan 2010
% Please acknowledge in any academic papers which may utilise this code

%% PLEASE NOTE. OPTITRACK SDK HAS RECENTLY BEEN SUPERCEDED BY CAMERA SDK WHICH IS IMPLEMENTED IN A DIFFERENT WAY AND THEREFORE THIS DEMO IS OUT OF DATE!!! I WILL WORK ON A NEW DEMO OF THE CAMERA SDK FOR POSTING AT A LATER DATE.

Comments and Ratings (2)

Greg Fricke

Sorry for the earlier post.
I realized that I was running an older version of MATLAB (7.1). I have now installed the latest release (2009b) and your function appears to work.
Thanks again for these helpful tools!

Greg Fricke

Thank you for these good demos, Glen! I found you via the NaturalPoint help forum.

I have downloaded both this package and TT_Tools_demo, hoping to get a developmental "leg up".

I encountered a problem right off the bat with this file. I am using V100R2:FLEX cameras. Currently I have only one camera attached (and no hub). When I attempt to run this function, I receive the following output:

Device Arrived
Device Arrived
Number of cameras = 2
??? Error using ==> registerevent
Input must be a scalar handle.

Error in ==> optitrack_data at 31
registerevent(h2,@frame_events);

The function reports 2 cameras because I have a Hardware Key (for the TT software license) installed; when I remove the key, the camera count drops to 1 but the error is the same. Any thoughts, or is this simply a problem with V100R2:FLEX cameras (as opposed to the TrackIR4 for which you developed this code)?

Thanks!

Updates

1.1

%% OPTITRACK SDK HAS RECENTLY BEEN SUPERCEDED BY CAMERA SDK WHICH IS IMPLEMENTED IN A DIFFERENT WAY AND THEREFORE THIS DEMO IS OUT OF DATE!!! I WILL WORK ON A NEW DEMO OF THE CAMERA SDK FOR POSTING AT A LATER DATE.

MATLAB Release
MATLAB 7.7 (R2008b)

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

» Watch video