Main Content

trackingScenarioRecording

Tracking scenario recording

Description

Use the trackingScenarioRecording object to record a tracking scenario.

Creation

Description

example

TSR = trackingScenarioRecording(recordedData) returns a trackingScenarioRecording object TSR using the recorded data. recordedData sets the value of the RecordedData property.

TSR = trackingScenarioRecording(recordedData,Name,Value) sets properties using one or more name-value pairs. Enclose each property name in quotes.

Input Arguments

expand all

Recorded data, specified as a structure. The fields of the structure are the same as the fields of the output of the record method of trackingScenario.

Properties

expand all

Recorded data stored in the recording object, specified as a structure. You can set this property only when creating the object. The fields of the structure are the same as the fields of the output of the record method of trackingScenario.

Timestamp of the latest read data, specified as a nonnegative scalar. When you use the read method on the object, the method reads the recorded dataset that has SimulationTime larger than the CurrentTime.

Step index of the latest read data, specified as a nonnegative integer. When you use the read method on the object, the method reads the next-step dataset.

Object Functions

readRead recorded data
isDoneEnd-of-data status

Examples

collapse all

Load recorded data from a prerecorded scenario called recordedScenario. Construct a trackingScenarioRecording object using the recorded data.

load recordedScenario recordedData
recording = trackingScenarioRecording(recordedData);

Construct a theater plot to display the recorded data using multiple plotters.

tp = theaterPlot('AxesUnits', ["km" "km" "km"], 'XLimits',[-50 50]*1e3,...
    'YLimits',[-50 50]*1e3,'ZLimits', [-20 20]*1e3);
to = platformPlotter(tp,'DisplayName','Tower','Marker','d');
pp = platformPlotter(tp,'DisplayName','Targets');
dp = detectionPlotter(tp,'DisplayName','Detections','MarkerFaceColor','black');
cp = coveragePlotter(tp,'DisplayName','Radar Beam');

coverage = struct('Index',1,'LookAngle',[0;-7],'FieldOfView',[1;10],...
    'ScanLimits',[0 365;-12 -2],'Range',100e3,'Position',[0;0;-15],...
    'Orientation',eye(3));

Run the recorded scenario and animate the results.

scanBuffer = {};
while ~isDone(recording)
    % Step the reader to read the next frame of data
    [simTime,poses,covcon,dets,senconfig] = read(recording);
    scanBuffer = [scanBuffer;dets]; %#ok<AGROW>
    plotPlatform(to,poses(1).Position);
    plotPlatform(pp,reshape([poses(2:4).Position]',3,[])');
    plotCoverage(cp,covcon);
    if ~isempty(dets)
        plotDetection(dp,cell2mat(cellfun(@(c) c.Measurement(:)', scanBuffer, 'UniformOutput', false)));
    end
    
    % Clear the buffer when a 360 degree scan is complete
    if senconfig.IsScanDone
        scanBuffer = {};
        dp.clearData;
    end
end

Introduced in R2020a