Skip to content

Commit

Permalink
Prevent GapFill from getting stuck in when the gaps can't be filled
Browse files Browse the repository at this point in the history
- Including print statement / warning to tell the user that the process could not fill all the gaps.
- machfiles is lowercase
  • Loading branch information
JonathanCamargo committed Nov 17, 2020
1 parent 8f66647 commit 8edb7db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion +Osim/IK.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
ikTool.run();
fprintf('Writing inverse kinematics output file to: %s\n',motOutputFile);
if nargout > 1
markerResultFile = matchFiles(fullfile(resultsDir, '*locations.sto'));
markerResultFile = matchfiles(fullfile(resultsDir, '*locations.sto'));
%calculateMarkerErrors is defined at the bottom
stoTable=Osim.readSTO(markerResultFile{1});
stoTable.Properties.VariableNames(2:end) = cellfun(@(x) {x([1:end-2, end])} , stoTable.Properties.VariableNames(2:end));
Expand Down
19 changes: 15 additions & 4 deletions +Vicon/GapFill.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@
warning('Spline-filling Large gap');
end
end
markerData = Vicon.SplineFill(markerData, gapTable.Markers{1}, gapTable.Start(1), gapTable.End(1));
spFills = spFills + 1;
gapTable = genGapTable(markerData);
change = true;
[markerData,err] = Vicon.SplineFill(markerData, gapTable.Markers{1}, gapTable.Start(1), gapTable.End(1));
if ~err
spFills = spFills + 1;
gapTable = genGapTable(markerData);
change = true;
else
change=false;
unFilledGaps=height(gapTable);
end
end
end
%delete(h);
Expand All @@ -128,8 +133,14 @@
' %d gaps filled with pattern fill.\n' ...
' %d gaps filled with spline fill.\n' ...
' %d one-frame gaps filled with spline fill.\n'], rbFills, ptFills, spFills, shortSpFills);
if unFilledGaps>0
fprintf(' %d gaps could not be filled\n',unFilledGaps);
end
else
fprintf(' %d gaps filled\n', rbFills + ptFills + spFills + shortSpFills);
if unFilledGaps>0
warning(' %d gaps could not be filled\n',unFilledGaps);
end
end
end
end
Expand Down

0 comments on commit 8edb7db

Please sign in to comment.