Code covered by the BSD License  

Highlights from
VU-Kinect

image thumbnail

VU-Kinect

by

 

A simple Simulink interface to the libfreenect Kinect driver for Linux-based systems

installKinect(cmd,rootInstallDir,downloadDir)
function installKinect(cmd,rootInstallDir,downloadDir)

%INSTALLER Installs the VU-Kinect Simulink block (S-Function) and associated third party tools
%
%
% Signature
%   Author: James Peyton Jones
%   Date: March 2012
%   Copyright: 2012 Villanova University

% Configuration Section          
clc; clear;
disp(' ');
disp('***********************************************');
disp('*                                             *');
disp('*  Villanova University Kinect Block          *');
disp('*  Installer, ver 1.0                         *');
disp('*                                             *');
disp('***********************************************');
disp('***********************************************');
disp('*                                             *');
disp('*  If, for whatever reason, the install fails,*');
disp('*  enter the following commands in a terminal:*');
disp('*  sudo add-apt-repository ppa:floe/libtisch  *');
disp('*  sudo apt-get update                        *');
disp('*  sudo apt-get install libfreenect libfreenect-dev *');
disp('*  NAME=`whoami`; sudo adduser $NAME video''  *');
disp('*                                             *');
disp('*  Then in a matlab terminal, in the install  *');
disp('*  directory, enter this command:             *');
disp('*  mex VU_Kinect.cpp /usr/lib/libfreenect.so *');
disp('***********************************************');

% add libfreenect repository to aptitude list
disp('Adding libfreenect repository');
[status,result]=system('xterm -e sudo add-apt-repository ppa:floe/libtisch');
        if status==0, disp('...Done'),
        else disp('...Did not appear to download correctly.');
        end;


% resynchronize list of packages from repository 
disp('Resynchronizing list of packages from repository');
[status,result]=system('xterm -e sudo apt-get update');
        if status==0, disp('...Done'),
        else disp('...Did not appear to download correctly.');
        end;
        
% install libfreenect shared library, libfreenect.so, in Linux file system
disp('install libfreenect.so shared library');
[status,result]=system('xterm -e sudo apt-get install libfreenect libfreenect-dev');
        if status==0, disp('...Done'),
        else disp('...Did not appear to download correctly.');
        end;

% Check C Mex Compiler is ok, and then compile 'fromKinect.cpp'
disp('Compiling Mex Files');
        try 
            mexCompiler = mex.getCompilerConfigurations('C','Selected');
            eval('mex VU_Kinect.cpp /usr/lib/libfreenect.so');
            disp('...Done');
        catch
            disp(' ');
            disp('...WARNING:  A C compiler is either not installed, or has been installed ');
            disp('   but has not been selected => Mex files cannot be compiled');
            disp('   You may need to run mex - setup to select one of the installed C compilers');
            disp('   Then re-run the installer');
        end;


% add your linux username to 'video' group
disp('Adding current username to video group');
[status,result]=system('xterm -e ''NAME=`whoami`; sudo adduser $NAME video''');
        if status==0, disp('...Done'),
        else disp('...Did not appear to download correctly.');
        end;
        
% set the Matlab search path
disp('Setting Matlab search path');
addpath(pwd);               % Path to VU-Kinect




Contact us