主要内容

coveragePlotter

R2026b

Coverage plotter for theater plot

Description

A CoveragePlotter object defines a coverage plotter belonging to a theaterPlot object. Use the plotCoverage function to plot sensor coverage areas using the CoveragePlotter object.

Creation

Description

cPlotter = coveragePlotter(tp) creates a CoveragePlotter object for use with the theater plot object, tp.

cPlotter = coveragePlotter(tp,Name,Value) creates a CoveragePlotter object with additional options specified by one or more name-value arguments. Specify optional properties using name-value arguments. For example, coveragePlotter(tp,"DisplayName","Radar1") sets the legend display name.

example

Input Arguments

expand all

Theater plot, specified as a theaterPlot object.

Properties

expand all

Plot name to display in legend, specified as a character vector or string scalar. If you do not specify this property, no entry is shown in the legend.

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.

Object Functions

plotCoveragePlot set of beams and scan limits in theater coverage plotter
clearDataClear data from specific plotter of theater plot
clearPlotterDataClear plotter data from theater plot

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)

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains an object of type patch. This object represents Sensor Coverage.

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 =fusionRadarSensor(radarIndex,'No Scanning','RangeLimits',[0 1e8]);
RasterIndex = 2;
raster = fusionRadarSensor(RasterIndex,'Raster','RangeLimits',[0 1e8]);

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

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains an object of type patch. This object represents Sensor Coverage.

Version History

Introduced in R2020a