|
|
# ARTOA4 Tracking Plugin System
|
|
|
|
|
|
One major improvement to the new artoa version is the possibility to create your own tracking plugins. All tracking plugins have to be located in the plugins/tracking folder and the signature that is described below, to be recognized and fully working as a tracking plugin.
|
|
|
|
|
|
## File naming
|
|
|
|
|
|
The name of the MATLAB function file should be UpperCamelCase.m, e.g. SingleSource.m. In addition to that, the function name needs to be the same.
|
|
|
|
|
|
## Function signature
|
|
|
|
|
|
The ARTOA4 repository contains a MyTrackingMethod.m.sample file with the following content. It prints all the parameters that are given to the function. This is also a recommended way to start when creating your own plugin.
|
|
|
|
|
|
```matlab
|
|
|
function [positions, clockError] = MyTrackingMethod(pData, pSoundsourcePositions, pCombinationDetails, pStartEndPosition)
|
|
|
%MYTRACKINGMETHOD A sample function to write your own tracking algorithms
|
|
|
%
|
|
|
% Parameters:
|
|
|
% pData (struct):
|
|
|
% Data structured by soundsource. The toa is already corrected
|
|
|
% (e.g. doppler correction etc.)
|
|
|
% pSoundsourcePositions (struct):
|
|
|
% The soundsource positions [deg].
|
|
|
% pCombinationDetails (table):
|
|
|
% Contains all information of the current soundsource
|
|
|
% combination.
|
|
|
% pStartEndPosition (double, logical):
|
|
|
% Set to false if it has not been passed by artoa. Contains the
|
|
|
% desired start and end position as a matrix of row vectors.
|
|
|
%
|
|
|
%
|
|
|
% Returns:
|
|
|
% positions (double):
|
|
|
% The calculated list of segment positions as a X x 2 column vector.
|
|
|
% clockError (double):
|
|
|
% The estimated clock error.
|
|
|
|
|
|
%% Get reference position and all soundsource names that are involved
|
|
|
referencePosition = cellfun(@str2double, strsplit(pCombinationDetails.referencePosition{1}));
|
|
|
soundsourceNames = strsplit(pCombinationDetails.soundsources{1});
|
|
|
|
|
|
%% Show all data that has been passed to the plugin method
|
|
|
pData
|
|
|
pCombinationDetails
|
|
|
pSoundsourcePositions
|
|
|
|
|
|
%% Return NaN because this is a sample
|
|
|
positions = NaN(size(pData.(soundsourceNames{1}).date, 1), 2);
|
|
|
clockError = [];
|
|
|
|
|
|
end
|
|
|
```
|
|
|
|