% This function is part of the NMSM Pipeline, see file for full license.
%
% This function creates the joint kinematics splines to be generated once
% at the start of GCP and used to calculate the kinematic curves throughout
% the optimization
%
% jointKinematicSplines has 2 fields (position, velocity)
%
% (Array of double, int, int) -> (struct)
% Calculate new joint kinematics curves from data and deviations curves
function jointKinematicsBSplines = makeJointKinematicsBSplines(time, ...
degree, numNodes)
numPts = length(time);
interval = time(2)-time(1);
[N, Np, ~] = BSplineMatrices(degree, numNodes, numPts, interval);
jointKinematicsBSplines.position = N;
jointKinematicsBSplines.velocity = Np;
end