Skip to content
Snippets Groups Projects
Commit cf043237 authored by leprob001's avatar leprob001
Browse files

Bugfix, the plugin system registered only the first tracking method that has been found.

parent e0a8716f
No related branches found
No related tags found
No related merge requests found
184 185
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,8 @@ trackingMethods = artoaWorkspace.defaults.trackingMethods; ...@@ -9,7 +9,8 @@ trackingMethods = artoaWorkspace.defaults.trackingMethods;
%% Get plugin methods %% Get plugin methods
if (artoa.data.hasMember(artoaWorkspace, {'plugins', 'tracking', 'functionHandles'})) if (artoa.data.hasMember(artoaWorkspace, {'plugins', 'tracking', 'functionHandles'}))
trackingMethods = [trackingMethods fieldnames(artoaWorkspace.plugins.tracking.functionHandles)]; fnames = fieldnames(artoaWorkspace.plugins.tracking.functionHandles);
trackingMethods = [trackingMethods {fnames{:}}];
end end
end end
...@@ -28,7 +28,7 @@ if ~iscell(trackingHandles) ...@@ -28,7 +28,7 @@ if ~iscell(trackingHandles)
return; return;
end end
for i = 1:size(trackingHandles) for i = 1:length(trackingHandles)
trackingMethods.(func2str(trackingHandles{i})) = trackingHandles{i}; trackingMethods.(func2str(trackingHandles{i})) = trackingHandles{i};
end end
......
...@@ -42,7 +42,7 @@ segmentVelocities = struct(); ...@@ -42,7 +42,7 @@ segmentVelocities = struct();
soundsourceNames = unique(strsplit(strtrim(pCombinationDetails.soundsources{1}), ' ')); soundsourceNames = unique(strsplit(strtrim(pCombinationDetails.soundsources{1}), ' '));
%% Get tracking method %% Get tracking method
trackingMethod = lower(pCombinationDetails.trackingMethod{:}); trackingMethod = pCombinationDetails.trackingMethod{:};
%% Get start and end point %% Get start and end point
segmentStart = pCombinationDetails{1, 1}; segmentStart = pCombinationDetails{1, 1};
...@@ -136,14 +136,14 @@ for oDates = 1:length(intersectedToaDates) ...@@ -136,14 +136,14 @@ for oDates = 1:length(intersectedToaDates)
end end
warning('on'); warning('on');
if strcmp(trackingMethod, 'hyperbolic') && (length(soundsourceNames) < 3) if strcmp(trackingMethod, 'Hyperbolic') && (length(soundsourceNames) < 3)
trackingMethod = 'circular'; trackingMethod = 'Circular';
end end
switch trackingMethod switch trackingMethod
case {'least square', 'exclusive least square'} case {'Least Square', 'Exclusive Least Square'}
for oDates = 1:length(intersectedToaDates) for oDates = 1:length(intersectedToaDates)
if strcmp(trackingMethod, 'exclusive least square') ... if strcmp(trackingMethod, 'Exclusive Least Square') ...
&& (sum(~isnan(distanceToSoundsources{oDates})) ~= length(soundsourcePositions)) && (sum(~isnan(distanceToSoundsources{oDates})) ~= length(soundsourcePositions))
segmentPositions = [segmentPositions; [NaN, NaN]]; segmentPositions = [segmentPositions; [NaN, NaN]];
segmentClockError = [segmentClockError; NaN(1, 3)]; segmentClockError = [segmentClockError; NaN(1, 3)];
...@@ -154,7 +154,7 @@ switch trackingMethod ...@@ -154,7 +154,7 @@ switch trackingMethod
]; ];
segmentClockError = [segmentClockError; NaN(1, 3)]; segmentClockError = [segmentClockError; NaN(1, 3)];
end end
case 'circular' case 'Circular'
for oDates = 1:length(intersectedToaDates) for oDates = 1:length(intersectedToaDates)
distances = distanceToSoundsources{oDates}; distances = distanceToSoundsources{oDates};
segmentPositions = [segmentPositions; ... segmentPositions = [segmentPositions; ...
...@@ -162,7 +162,7 @@ switch trackingMethod ...@@ -162,7 +162,7 @@ switch trackingMethod
]; ];
segmentClockError = [segmentClockError; NaN(1, 3)]; segmentClockError = [segmentClockError; NaN(1, 3)];
end end
case 'hyperbolic' case 'Hyperbolic'
for oDates = 1:length(intersectedToaDates) for oDates = 1:length(intersectedToaDates)
distances = distanceToSoundsources{oDates}; distances = distanceToSoundsources{oDates};
if any(isnan(distances)) if any(isnan(distances))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment