Main Content

isDone

Indicates end of radar scenario recording

Since R2021a

Description

tf = isDone(recording) returns true if you have reached the end of data in the radar scenario recording and false otherwise. Use isDone to check if the you have reached the end of the recording before reading the next step in the recording.

example

Examples

collapse all

Load prerecorded data from a radar scenario. The data is saved as a struct with the variable name recordedData. Create a radarScenarioRecording object using the recorded data.

load recordedRadarScenarioData.mat
recording = radarScenarioRecording(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

Input Arguments

collapse all

Radar scenario recording, specified as a radarScenarioRecording object.

Output Arguments

collapse all

Recording has reached the end, returned as true or false.

Version History

Introduced in R2021a