% This function is part of the NMSM Pipeline, see file for full license.
%
% This function sets up the input variables and mex files (or parallel
% matlab function) for the main function verification optimization.
%
% (struct, struct) -> (struct, struct)
% Inputs for the main function are setup
function [output, inputs] = VerificationOptimization(inputs, params)
inputs = makeTreatmentOptimizationInputs(inputs, params);
initializeMexOrMatlabParallelFunctions(inputs.mexModel);
if strcmp(inputs.controllerType, 'synergy_driven')
inputs = setupMuscleSynergies(inputs);
end
output = computeVerificationOptimizationMainFunction(inputs, params);
end
function inputs = setupMuscleSynergies(inputs)
inputs.splineSynergyActivations = spaps(inputs.initialGuess.time, ...
inputs.initialGuess.control(:, inputs.numCoordinates + 1:end)', 0.0000001);
inputs.synergyLabels = inputs.initialGuess.controlLabels(:, inputs.numCoordinates + 1:end);
end