Create coverage plotter
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 and visualize the results. The dark blue represents the current sensor beam, and the light blue repreents 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
tp
— Theater plottheaterPlot
objectTheater plot, specified as a theaterPlot
object.
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
.
'DisplayName', 'Radar1'
'DisplayName'
— Plot name to display in legendPlot 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'
'Color'
— Coverage area and sensor beam color'auto'
(default) | character vector | string scalar | RGB triplet | hexadecimal color codeCoverage 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.
'Alpha'
— Face alpha values of coverage area and sensor beam[0.7 0.05]
(default) | 2-element vector of nonnegative scalarsFace 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'
— Tag associated with plotter'PlotterN'
(default) | character vector | stringTag 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
.
cPlotter
— Coverage plotterCoveragePlotter
objectCoverage 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.
You have a modified version of this example. Do you want to open this example with your edits?