% This function is part of the NMSM Pipeline, see file for full license.
%
%
%
% (Model, string) -> (Array of string)
% Finds the names of all joints associated with a body
function joints = getBodyJointNames(model, bodyName)
joints = string([]);
for i = 0 : model.getJointSet().getSize() - 1
[parent, child] = getJointBodyNames(model, ...
model.getJointSet().get(i).getName().toCharArray');
if strcmp(parent, bodyName) || strcmp(child, bodyName)
joints(end + 1) = ...
model.getJointSet().get(i).getName().toCharArray';
end
end
end