Main Content

birdsEyePlot

Plot detections, tracks, and sensor coverages around vehicle

Description

The birdsEyePlot object displays a bird's-eye plot of a 2-D driving scenario in the immediate vicinity of an ego vehicle. You can use this plot with sensors capable of detecting objects and lanes.

To display aspects of a driving scenario on a bird’s-eye plot:

  1. Create a birdsEyePlot object.

  2. Create plotters for the aspects of the driving scenario that you want to plot.

  3. Use the plotters with their corresponding plot functions to display those aspects on the bird's-eye plot.

This table shows the plotter functions to use based on the driving scenario aspect that you want to plot.

Driving Scenario Aspect to PlotPlotter Creation FunctionPlotter Display Function
Sensor coverage areascoverageAreaPlotterplotCoverageArea
Sensor detectionsdetectionPlotter, rangeDetectionPlotterplotDetection, plotRangeDetection
Lane boundarieslaneBoundaryPlotterplotLaneBoundary
Lane markingslaneMarkingPlotterplotLaneMarking, plotParkingLaneMarking
Object meshesmeshPlotterplotMesh
Object outlinesoutlinePlotterplotOutline, plotBarrierOutline
Ego vehicle pathpathPlotterplotPath
Point cloudpointCloudPlotterplotPointCloud
Object tracking resultstrackPlotterplotTrack

For an example of how to configure and use a bird's-eye plot, see Visualize Sensor Coverage, Detections, and Tracks.

Creation

Description

bep = birdsEyePlot creates a bird’s-eye plot in a new figure.

example

bep = birdsEyePlot(Name,Value) sets properties using one or more Name,Value pair arguments. For example, birdsEyePlot('XLimits',[0 60],'YLimits',[-20 20]) displays the area that is 60 meters in front of the ego vehicle and 20 meters to either side of the ego vehicle. Enclose each property name in quotes.

Properties

expand all

Axes on which to plot, specified as an axes handle. By default, the birdsEyePlot object uses the current axes handle, which is returned by the gca function.

Plotters created for the bird's-eye plot, specified as an array of plotter objects.

X-axis range of the bird's-eye plot, in vehicle coordinates, specified as a real-valued vector of the form [Xmin Xmax]. Units are in meters. If you do not specify XLimits, then the plot uses the default values for the parent axes.

The X-axis is vertical and positive in the forward direction of the ego vehicle. The origin is at the center of the rear axle of the ego vehicle.

Empty bird's-eye plot with Xmin and Xmax labeled on vertical X-axis

For more details on the coordinate system used in the bird's-eye plot, see Vehicle Coordinate System.

Y-axis range of the bird's-eye plot, in vehicle coordinates, specified as a real-valued vector of the form [Ymin Ymax]. Units are in meters. If you do not specify YLimits, then the plot uses the default values for the parent axes.

The Y-axis runs horizontally and is positive to the left of the ego vehicle, as viewed when facing forward. The origin is at the center of the rear axle of the ego vehicle.

Empty bird's-eye plot with Ymin and Ymax labeled on horizontal Y-axis

For more details on the coordinate system used in the birdsEyePlot object, see Vehicle Coordinate System.

Object Functions

expand all

coverageAreaPlotterCoverage area plotter for bird's-eye plot
detectionPlotterDetection plotter for bird's-eye plot
laneBoundaryPlotterLane boundary plotter for bird's-eye plot
laneMarkingPlotterLane marking plotter for bird's-eye plot
meshPlotterMesh plotter for bird's-eye plot
outlinePlotterOutline plotter for bird's-eye plot
pathPlotterPath plotter for bird's-eye plot
pointCloudPlotterPoint cloud plotter for bird's-eye plot
trackPlotterTrack plotter for bird's-eye plot
plotCoverageAreaDisplay sensor coverage area on bird's-eye plot
plotDetectionDisplay object detections on bird's-eye plot
plotLaneBoundaryDisplay lane boundaries on bird’s-eye plot
plotLaneMarkingDisplay lane markings on bird’s-eye plot
plotParkingLaneMarkingDisplay parking lane markings on bird’s-eye plot
plotMeshDisplay object meshes on bird's-eye plot
plotOutlineDisplay object outlines on bird's-eye plot
plotPathDisplay actor paths on bird’s-eye plot
plotPointCloudDisplay generated point cloud on bird's-eye plot
plotTrackDisplay object tracks on bird's-eye plot
clearDataClear data from specific plotter of bird’s-eye plot
clearPlotterDataClear data from bird’s-eye plot
findPlotterFind plotters associated with bird’s-eye plot

Examples

collapse all

Create a bird's-eye plot with an x-axis range from 0 to 90 meters and a y-axis range from –35 to 35 meters.

bep = birdsEyePlot('XLim',[0 90],'YLim',[-35 35]);

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) is empty.

Display a coverage area with a 35-degree field of view and a 60-meter range.

caPlotter = coverageAreaPlotter(bep,'DisplayName','Radar coverage area');
mountPosition = [1 0];
range = 60;
orientation = 0;
fieldOfView = 35;
plotCoverageArea(caPlotter,mountPosition,range,orientation,fieldOfView);

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

Display radar detections with coordinates at (30, –5), (50, –10), and (40, 7).

radarPlotter = detectionPlotter(bep,'DisplayName','Radar detections');
plotDetection(radarPlotter,[30 -5; 50 -10; 40 7]);

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains 2 objects of type patch, line. One or more of the lines displays its values using only markers These objects represent Radar coverage area, Radar detections.

Create a bird's-eye plot with an x-axis range of 0 to 90 meters and a y-axis range from –35 to 35 meters. Configure the plot to include a radar coverage area plotter and a detection plotter. Set the display names of these plotters.

bep = birdsEyePlot('XLim',[0 90],'YLim',[-35 35]);
coverageAreaPlotter(bep,'DisplayName','Radar coverage area');
detectionPlotter(bep,'DisplayName','Radar detections');

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains 2 objects of type patch, line. One or more of the lines displays its values using only markers These objects represent Radar coverage area, Radar detections.

Use findPlotter to locate the plotters by their display names.

caPlotter = findPlotter(bep,'DisplayName','Radar coverage area');
radarPlotter = findPlotter(bep,'DisplayName','Radar detections');

Plot the coverage area and detected objects.

plotCoverageArea(caPlotter,[1 0],30,0,35);
plotDetection(radarPlotter,[30 5; 30 -10; 30 15]);

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains 2 objects of type patch, line. One or more of the lines displays its values using only markers These objects represent Radar coverage area, Radar detections.

Clear data from the plot.

clearPlotterData(bep);

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains 2 objects of type patch, line. One or more of the lines displays its values using only markers These objects represent Radar coverage area, Radar detections.

Limitations

The rectangle-zoom feature, where you draw a rectangle to zoom in on a section of a figure, does not work in bird's-eye plot figures.

More About

expand all

Version History

Introduced in R2017a