Here is the code I am running:
Code: Select all
%% Static Optimization
soTool = AnalyzeTool(fullfile(GeneralPath, '\', 'SetUp_SO_generic.xml'));
soTool.setModel(model);
soTool.setModelFilename(fullfile(modelFilePath,modelFile));
soTool.setName(filelabel);
soTool.setInitialTime(initial_time);
soTool.setFinalTime(final_time);
soTool.setResultsDir(SOPath);
soTool.setCoordinatesFileName(fullfile(IKResultsPath,'\', sprintf('%s_IK.mot',filelabel)));
soTool.setExternalLoadsFileName(fullfile(IDResultsPath, '\',sprintf('Setup_ExtLoads_%s.xml',filelabel)));
% Instantiate a String Array
Reserve = ArrayStr();
% Int sets the number of spaces in the xml file
Reserve.set(0, [GeneralPath '\' 'StaticTIGHT_Reserves.xml']);
soTool.setForceSetFiles(Reserve);
so_setup_file = ['Setup_SO_' filelabel '.xml'];
soTool.print(fullfile(SOPath,'\',so_setup_file));
display(['Performing SO on ' filelabel]);
% Run Static Op Tool
soTool.run()