Main Content

laneBoundaryGroup

Group lane boundaries in lane boundary segment objects

Since R2024a

Description

The laneBoundaryGroup object connects lane boundary segments and stores them as lane boundary groups.

Creation

Description

example

lbgroup = laneBoundaryGroup(lbsegments) creates a 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.

example

lbgroup = laneBoundaryGroup(lbsegments,Name=Value) sets properties or specifies additional options using one or more name-value arguments. For example, 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

expand all

Name-Value 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.

Boundary connection type, specified as "boundaryID", "nearestBoundary", or "custom".

  • "boundaryID" — Connects lane boundaries from multiple laneBoundarySegment objects that have the same lane boundary IDs to create lane groups.

  • "nearestBoundary" — Connects lane boundaries in one laneBoundarySegment object with their nearest lane boundaries in another laneBoundarySegment object to create lane groups.

  • "custom" — Create custom boundary connections by specifying the SegmentConnections property.

Data Types: string

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

expand all

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.

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);
In this example, the first column of the 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

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 in BoundaryIDs and SegmentIndices.

    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

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

plotPlot lane boundary points
updateSegmentConnectionsUpdate lane boundary segment connections
smoothBoundariesSmooth lane boundaries

Examples

collapse all

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: []

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)

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

Version History

Introduced in R2024a