clear all;close all;clc; FILE = 'kinect_struct_standalone'; home_dir = ' /home/robocup/svn/trunk/src/Turtle2'; %remove build directories try rmdir('slprj','s'); rmdir([FILE '_*'],'s'); warning('off','MATLAB:DELETE:FileNotFound'); delete(FILE); warning('on','MATLAB:DELETE:FileNotFound'); disp('build directories have been removed') catch end load_system(FILE); cs = getActiveConfigSet(FILE); set(cs.Components(1),'FixedStep',num2str(1/30)); %set the rtw custom code properties set_param(cs,'CustomInclude',[home_dir '/Libs/kinect/include' home_dir '/Global_par' home_dir '/WorldModel/include' home_dir '/Libs/ipcomm2' home_dir '/Libs/GeneralFunctions']) set_param(cs,'CustomSource','') set_param(cs,'CustomLibrary',['/usr/local/lib/libfreenect.so' home_dir '/Libs/GeneralFunctions/generic_functions.o' home_dir '/Libs/GeneralFunctions/generic_object_lib.o']) %change the Simulink target file and make options switchTarget(cs,'mttarget.tlc',[]); set_param(cs,'TemplateMakefile','mt_unix.tmf') set_param(cs,'MakeCommand',['make_rtw CC="ccache gcc" OPTS="-DTIMER_ID=2 -D_GNU_SOURCE -DNO_EC"']) pause(2) %save and close the system save_system(FILE); close_system(FILE); % build executable rtwbuild(FILE)