%% Display Sensor Coverage Areas from Four Corners of Vehicle
% Create a bird's-eye plot with an x-axis range from –100 to 100 meters and a y-axis range from –100 to 100 meters

bep = birdsEyePlot('XLim',[-100 100],'YLim',[-100 100]);

%
% Create coverage area plotters with unique display names and fill colors for each sensor location on the vehicle.

rearLeftPlotter = coverageAreaPlotter(bep,'DisplayName','Rear left','FaceColor','r');
rearRightPlotter = coverageAreaPlotter(bep,'DisplayName','Rear right','FaceColor','b');
frontLeftPlotter = coverageAreaPlotter(bep,'DisplayName','Front left','FaceColor','y');
frontRightPlotter = coverageAreaPlotter(bep,'DisplayName','Front right','FaceColor','g');

%
% Set the positions, ranges, orientations, and fields of view for the sensors. The sensors have a maximum range of 90 meters and a field of view of 30 degrees. Plot the coverage areas.

plotCoverageArea(rearLeftPlotter,[0 0.9],90,120,30);
plotCoverageArea(rearRightPlotter,[0 -0.9],90,-120,30);
plotCoverageArea(frontLeftPlotter,[2.8 0.9],90,60,30);
plotCoverageArea(frontRightPlotter,[2.8 -0.9],90,-60,30);

% Copyright 2012 The MathWorks, Inc.