%% Create 2-D Constant Turn-rate UKF from Spherical Measurement
% Initialize a 2-D constant turn-rate extended Kalman filter from an initial detection report made from an initial measurement in spherical coordinates. If you want to use spherical coordinates, then you must supply a measurement parameter structure as part of the detection report with the Frame field set to 'spherical'. Set the azimuth angle of the target to 45 degrees and the range to 1000 meters.

frame = 'spherical';
sensorpos = [25,-40,-10].';
sensorvel = [0;5;0];
laxes = eye(3);

%
% Create the measurement parameters structure. Set 'HasVelocity' and 'HasElevation' to false. Then, the measurement consists of azimuth and range.

measparms = struct('Frame',frame,'OriginPosition',sensorpos, ...
    'OriginVelocity',sensorvel,'Orientation',laxes,'HasVelocity',false, ...
    'HasElevation',false);
meas = [45;1000];
measnoise = diag([3.0,2].^2);
detection = objectDetection(0,meas,'MeasurementNoise', ...
    measnoise,'MeasurementParameters',measparms)
filter = initctukf(detection);

%
% Filter state vector.

disp(filter.State)

% Copyright 2017 The MathWorks, Inc.
%
%