Skip to main content

getSplines.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the splines for all experimental data. These
% splines are evaluated at the collocation points to allow tracking of
% these quanitites during treatment optimization
%
% (struct) -> (struct)
% Calculates the splines for all experimental data


function inputs = getSplines(inputs)
inputs.splineJointAngles = spaps(inputs.experimentalTime, ...
inputs.experimentalJointAngles', 0.0000001);
inputs.splineJointMoments = spaps(inputs.experimentalTime, ...
inputs.experimentalJointMoments', 0.0000001);
if strcmp(inputs.controllerType, 'synergy_driven')
inputs.splineMuscleActivations = spaps(inputs.experimentalTime, ...
inputs.experimentalMuscleActivations', 0.0000001);
end
for i = 1:length(inputs.contactSurfaces)
inputs.splineExperimentalGroundReactionForces{i} = ...
spaps(inputs.experimentalTime, ...
inputs.contactSurfaces{i}.experimentalGroundReactionForces', 0.0000001);
inputs.splineExperimentalGroundReactionMoments{i} = ...
spaps(inputs.experimentalTime, ...
inputs.contactSurfaces{i}.experimentalGroundReactionMoments', 0.0000001);
end
end