plotParkingLaneMarking
Description
plotParkingLaneMarking(
displays parking lane marking vertices lmPlotter
,plmv
,plmf
)plmv
and parking lane marking
faces plmf
on a bird's-eye plot. The lane marking plotter
lmPlotter
is associated with a birdsEyePlot
object and configures the display of the specified lane
markings.
To remove all lane markings associated with the lane marking plotter
lmPlotter
, use the clearData
function and specify lmPlotter
as the input argument.
Examples
Generate Detections of Cars in Parking Lot
Generate detections of cars parked in a parking lot, and plot the detections on a bird's-eye plot.
Create a driving scenario containing a road and parking lot.
scenario = drivingScenario; roadcenters = [10 40; 10 -40]; road(scenario,roadcenters); vertices = [0 20; 20 20; 20 -20; 0 -20]; parkingLot(scenario,vertices,ParkingSpace=parkingSpace);
Add an ego vehicle and specify a trajectory in which the vehicle drives through the parking lot.
ego = vehicle(scenario);
waypoints = [10 35 0; 10 10 0];
speed = 5; % m/s
smoothTrajectory(ego,waypoints,speed)
Create parked cars in several parking spaces. Plot the scenario.
parkedCar1 = vehicle(scenario,Position=[15.8 12.4 0]); parkedCar2 = vehicle(scenario,Position=[15.8 -12.4 0]); parkedCar3 = vehicle(scenario,Position=[2 -9.7 0]); parkedCar4 = vehicle(scenario,Position=[2 9.7 0]); plot(scenario)
Create a vision sensor for generating the detections. By default, the sensor is mounted to the front bumper of the ego vehicle.
sensor = visionDetectionGenerator;
Create a bird's-eye plot and plotters for visualizing the target outlines, road boundaries, parking lane markings, sensor coverage area, and detections. Then, simulate the scenario and generate the detections.
bep = birdsEyePlot(XLim=[-40 40],YLim=[-30 30]); olPlotter = outlinePlotter(bep); lbPlotter = laneBoundaryPlotter(bep); lmPlotter = laneMarkingPlotter(bep,DisplayName="Parking lanes"); caPlotter = coverageAreaPlotter(bep,DisplayName="Coverage area"); detPlotter = detectionPlotter(bep,DisplayName="Detections"); while advance(scenario) % Plot target outlines. [position,yaw,length,width,originOffset,color] = targetOutlines(ego); plotOutline(olPlotter,position,yaw,length,width) % Plot lane boundaries of ego vehicle. rbEgo = roadBoundaries(ego); plotLaneBoundary(lbPlotter,rbEgo) % Plot parking lane markings. [plmv,plmf] = parkingLaneMarkingVertices(ego); plotParkingLaneMarking(lmPlotter,plmv,plmf) % Plot sensor coverage area. mountPosition = sensor.SensorLocation; range = sensor.MaxRange; orientation = sensor.Yaw; fieldOfView = sensor.FieldOfView(1); plotCoverageArea(caPlotter,mountPosition,range,orientation,fieldOfView) % Generate and plot detections. actors = targetPoses(ego); time = scenario.SimulationTime; [dets,isValidTime] = sensor(actors,time); if isValidTime positions = cell2mat(cellfun(@(x)([x.Measurement(1) x.Measurement(2)]), ... dets,UniformOutput=false)); plotDetection(detPlotter,positions) end end
Input Arguments
lmPlotter
— Lane marking plotter
LaneMarkingPlotter
object
Lane marking plotter, specified as a LaneMarkingPlotter
object.
This object is stored in the Plotters
property of a birdsEyePlot
object and configures the display of the specified parking lane
markings in the bird's-eye plot. To create this object, use the laneMarkingPlotter
function.
plmv
— Parking lane marking vertices
V-by-3 real-valued matrix
Parking lane marking vertices, specified as a V-by-3 real-valued
matrix. Each row of plmv
represents the x,
y, and z coordinates of one vertex in the lane
marking. The plotter uses only the x and y
coordinates. V is the number of vertices in the marking.
To obtain vertices and faces from parking lane markings in a driving scenario, use
the parkingLaneMarkingVertices
function.
plmf
— Parking lane marking faces
matrix of integers
Parking lane marking faces, specified as a matrix of integers. Each row of
plmf
is a face that defines the connection between vertices for
one parking lane marking. For more details, see Faces.
To obtain vertices and faces from parking lane markings in a driving scenario, use
the parkingLaneMarkingVertices
function.
Version History
Introduced in R2021b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)