laneBoundaryGroup
Description
The laneBoundaryGroup
object connects lane boundary segments and
stores them as lane boundary groups.
Creation
Description
creates a lbgroup
= laneBoundaryGroup(lbsegments
)laneBoundaryGroup
object lbgroup
that
contains lane boundary groups consisting of connected lane boundary segments from the
input laneBoundarySegment
objects lbsegments
. The
lbsegments
argument sets the BoundarySegments
property.
sets properties or
specifies additional options using one or more name-value arguments. For example,
lbgroup
= laneBoundaryGroup(lbsegments
,Name=Value
)AlignAllBoundaryPoints=true
aligns all the lane boundary points from
the input lane boundary segments laterally across the road.
Note
This object requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install the Scenario Builder for Automated Driving Toolbox support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
Input Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: laneBoundaryGroup(lbsegments,AlignAllBoundaryPoints=true)
aligns all the lane boundary points from the input lane boundary segments
lbsegments
.
ConnectBoundariesBy
— Boundary connection type
"boundaryID"
(default) | "nearestBoundary"
| "custom"
Boundary connection type, specified as "boundaryID"
,
"nearestBoundary"
, or "custom"
.
"boundaryID"
— Connects lane boundaries from multiplelaneBoundarySegment
objects that have the same lane boundary IDs to create lane groups."nearestBoundary"
— Connects lane boundaries in onelaneBoundarySegment
object with their nearest lane boundaries in anotherlaneBoundarySegment
object to create lane groups."custom"
— Create custom boundary connections by specifying theSegmentConnections
property.
Data Types: string
AlignAllBoundaryPoints
— Align lane boundary points status
false
or 0
(default) | true
or 1
Align lane boundary points status, specified as a logical 1
(true
) or 0
(false
).
If you specify true
, the object aligns the lane boundary
points laterally across the road for all lanes in the lane boundary segments.
Data Types: logical
Properties
BoundarySegments
— Lane boundary segments
N-by-1 array of laneBoundarySegment
objects
This property is read-only.
Lane boundary segments, specified as an N-by-1 array of laneBoundarySegment
objects. N is the number of lane
boundary segments.
Note
When setting the SegmentConnections
property, you must
specify lane boundary segment pairs using their indices from the
lbsegments
argument.
SegmentConnections
— Lane boundary connections between lane segments
P-by-2 cell array
This property is read-only.
Lane boundary connections between the lane segments, specified as a P-by-2 cell array. P is the number of lane boundary segment pairs.
For each row of the cell array, the first cell contains a two-element row vector of
the form [a
b] , where a and b are indices
of laneBoundarySegment
objects in the input lane boundary segments
array lbsegments
. For example, [1
2
] specifies that the lane boundary segment with index
1
connects to the lane boundary segment with index
2
.
The second cell of each row contains a Q-by-2 string array of lane boundary IDs. Q is the number of lane boundary connections for the corresponding pair of lane boundary segments. Each row specifies a lane boundary connection of the form [c d], where c is the lane boundary ID in lane boundary segment a that connects to lane boundary ID d in lane boundary segment b.
segmentPairIndices = [1 2]; boundaryConnections = ["3","4"; "5","6"; "7","8"]; connection = {segmentPairIndices boundaryConnections}; lbgroup = laneBoundaryGroup(lbsegments,ConnectBoundariesBy="custom",SegmentConnections=connection);
connection
cell array contains
a pair of lane boundary segment indices [1
2
]. The segment indices correspond to the indices in the input lane
boundary segments array lbsegments
. The second column of the
connection
cell array contains a 3-by-2 string array of lane
boundary IDs. The laneBoundaryGroup
object connects these lane boundaries:
The lane boundary with ID 3 of the lane boundary segment with index 1 connects to the lane boundary with ID 4 of the lane boundary segment with index 2.
The lane boundary with ID 5 of the lane boundary segment with index 1 connects to the lane boundary with ID 6 of the lane boundary segment with index 2.
The lane boundary with ID 7 of the lane boundary segment with index 1 connects to the lane boundary with ID 8 of the lane boundary segment with index 2.
Note
The SegmentConnections
property applies only when you specify
ConnectBoundariesBy
name-value argument as
"custom"
.
Data Types: cell
BoundaryGroups
— Lane boundary group information
1-by-M structure array
This property is read-only.
Lane boundary group information, specified as a 1-by-M structure array. M is the number of lane boundary groups, and each element of the structure contains information about the corresponding lane boundary group. The structure contains these fields:
BoundaryIDs
— Lane boundary IDs, specified as a 2-by-1 string array or a string scalar.SegmentIndices
— Lane boundary segment indices, specified as a two-element column vector or a positive numeric scalar.BoundaryPoints
— Lane boundary points, specified as a 2-by-1 cell array or a 1-by-1 cell. Boundary points are relative to the lane boundary identifiers inBoundaryIDs
andSegmentIndices
.Each cell contains a P-by-2 or P-by-3 matrix. P is the number of lane boundary points, and it must be greater than 1.
For a P-by-2 matrix, each row contains the xy-coordinates of a lane boundary point. The z-coordinate of each lane boundary point is
0
.For a P-by-3 matrix, each row contains the xyz-coordinates of a lane boundary point.
Data Types: struct
GeoReference
— Geographic coordinates of lane boundary origin
[]
(default) | three-element numeric row vector of form [lat
lon
alt
]
Geographic coordinates of the lane boundary origin, specified as a three-element
numeric row vector of the form [lat
lon
alt
], where:
lat
is the latitude of the coordinate, in degrees.lon
is the longitude of the coordinate, in degrees.alt
is the altitude of the coordinate, in meters.
These values must be with respect to the WGS84 reference ellipsoid, which is a standard ellipsoid used by GPS data.
Data Types: single
| double
Object Functions
plot | Plot lane boundary points |
updateSegmentConnections | Update lane boundary segment connections |
smoothBoundaries | Smooth lane boundaries |
Examples
Create Lane Boundary Group from Lane Boundary Segments
Load lane boundary data into the workspace.
data = load("laneBoundaryGroupData.mat","lbSegments");
Display the loaded lane boundary segment objects.
segments = data.lbSegments
Create a lane boundary group object from lane boundary segments.
lbGroup = laneBoundaryGroup(segments)
lbGroup = laneBoundaryGroup with properties: BoundarySegments: [2×1 laneBoundarySegment] SegmentConnections: {[1 2] [4×2 string]} BoundaryGroups: [1×5 struct] GeoReference: []
Create Groups of Lane Boundary Segments with Aligned Boundaries
Load lane boundary data into the workspace.
data = load("laneBoundaryGroupData.mat","lbSegments");
Display the loaded lane boundary segment object.
segments = data.lbSegments
Plot the loaded lane boundary segment objects.
plot(segments(1))
plot(segments(2))
Create a lane boundary group object from the lane boundary segments.
lbGroup = laneBoundaryGroup(segments)
lbGroup = laneBoundaryGroup with properties: BoundarySegments: [2×1 laneBoundarySegment] SegmentConnections: {[1 2] [4×2 string]} BoundaryGroups: [1×5 struct] GeoReference: []
Plot the lane boundary group object.
plot(lbGroup)
Create another lane boundary group object that aligns all the lane boundaries.
lbGroupAligned = laneBoundaryGroup(segments,AlignAllBoundaryPoints=true);
Plot the aligned lane boundary group object.
plot(lbGroupAligned)
Create Lane Boundary Group with Custom Lane Boundary Connections
Load lane boundary data into the workspace.
data = load("laneBoundaryGroupData.mat","lbSegments");
Display the loaded lane boundary segment objects.
segments = data.lbSegments
The loaded lane boundary segment data contains two segments, with indices 1 and 2. Specify the connections between these two segments.
segmentPairIndices = [1 2]; boundaryConnections = ["2","2"; "1","1"; "3","3"]; connection = {segmentPairIndices boundaryConnections};
Create a lane boundary group object that uses your specified custom connections.
lbGroup = laneBoundaryGroup(segments,ConnectBoundariesBy="custom",SegmentConnections=connection)
lbGroup = laneBoundaryGroup with properties: BoundarySegments: [2×1 laneBoundarySegment] SegmentConnections: {[1 2] [3×2 string]} BoundaryGroups: [1×6 struct] GeoReference: []
Plot the lane boundaries from the created lane boundary group object.
plot(lbGroup)
Tips
To obtain
laneBoundarySegment
objects for your tracked lane boundaries, you can use theegoToWorldLaneBoundarySegments
function.
Version History
Introduced in R2024a
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)