Skip to main content

calcFinalPointVelocity.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function calculates the final velocity for the specified
% point on the specified body. The difference between the final point
% velocity and target positon is calculated.
%
% (struct, struct, struct) -> (Number)
%


function finalPointVelocityErrorMag = calcFinalPointVelocity(auxdata, ...
values, constraintTerm)

pointVelocity = calcBodyVelocity(values, constraintTerm.point, ...
constraintTerm.body, auxdata);

finalPointVelocityError = pointVelocity(end, :) - ...
str2num(constraintTerm.target_velocity);
finalPointVelocityErrorMag = norm(finalPointVelocityError);
end