coveragePlotter

Create coverage plotter

Description

cPlotter = coveragePlotter(tp) creates a CoveragePlotter object for use with the theater plot object, tp. Use the plotCoverage function to plot the sensor coverage via the created CoveragePlotter object.

example

cPlotter = coveragePlotter(tp,Name,Value) creates a CoveragePlotter object with additional options specified by one or more Name,Value pair arguments.

Examples

collapse all

Create a theater plot and set the limits for its axes. Create a coverage plotter with DisplayName set to 'Sensor Coverage'.

tp = theaterPlot('XLim',[-40 40],'YLim',[-40 40],'ZLim',[-40 40]);
covp = coveragePlotter(tp,'DisplayName','Sensor Coverage');

Set up the configuration of the sensors whose coverage is to be plotted.

 sensor = struct('Index',1,'ScanLimits',[-45 45],'FieldOfView',[10;40],...
       'LookAngle',-10,'Range',30,'Position',zeros(1,3),'Orientation',zeros(1,3));

Plot the coverage using the plotCoverage function and visualize the results. The dark blue represents the current sensor beam, and the light blue represents the coverage area.

plotCoverage(covp,sensor)
view(70,30)

Create a theater plot and create a coverage plotter.

tp = theaterPlot('XLim',[-1e7 1e7],'YLim',[-1e7 1e7],'ZLim',[-2e6 1e6]);
covp = coveragePlotter(tp,'DisplayName','Sensor Coverage');
view(25,20)

Model a non-scanning radar and a raster scanning radar.

radarIndex = 1;
radar = monostaticRadarSensor(radarIndex,'No Scanning');
RasterIndex = 2;
raster = monostaticRadarSensor(RasterIndex,'Raster');

Create a target platform.

tgt = struct( ...
        'PlatformID', 1, ...
        'Position', [0 -50e3 -1e3], ...
        'Speed', -1e3);

Simulate sensors and visualize their scanning pattern.

time = 0;
timestep = 1;
stopTime = 90;
while time < stopTime
    time = time+timestep;
    radar(tgt,time);
    raster(tgt,time);
    
    % Obtain sensor configuration using coverageConfig. 
    radarcov = coverageConfig(radar);
    ircov = coverageConfig(raster);
    
    % Update plotter
    plotCoverage(covp,[radarcov,ircov],... 
        [radarIndex, RasterIndex],... 
        {'blue','red'}... 
        );
    pause(0.03)
end

Input Arguments

collapse all

Theater plot, specified as a theaterPlot object.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'DisplayName', 'Radar1'

Plot name to display in legend, specified as the comma-separated pair consisting of 'DisplayName' and a character vector or string scalar. If no name is specified, no entry is shown.

Example: 'DisplayName','Radar Detections'

Coverage area and sensor beam color, specified as a character vector, a string scalar, an RGB triplet, a hexadecimal color code, or 'auto'. When a color is specified, the plotter draws all coverage areas and beams with the specified color. If the color is set to 'auto', the plotter uses the axis color order to assign colors to sensors based on their sensor indices.

Face alpha values of the coverage area and the sensor beam, specified as a 2-element vector of nonnegative scalars. The first element is the value applied to the beam and the second element is the value applied to the coverage area.

Tag associated with the plotter, specified as a character vector or string. You can use the findPlotter function to identify plotters based on their tag. The default value is 'PlotterN', where N is an integer that corresponds to the Nth plotter associated with the theaterPlot.

Output Arguments

collapse all

Coverage plotter, returned as a CoveragePlotter object. You can modify this object by changing its property values. The property names correspond to the name-value pair arguments of the coveragePlotter function.

To plot the coverage, use the plotCoverage function.

Introduced in R2020a