Main Content

updateSegmentConnections

Update lane boundary segment connections

Since R2024a

Description

lbgroupUpdated = updateSegmentConnection(lbgroup,segmentPairs,boundaryMapping) updates the connections of the specified lane boundary segment pairs segmentPairs in the laneBoundaryGroup object lbgroup by using the boundary mapping boundaryMapping, and returns an updated laneBoundaryGroup object lbgroupUpdated.

Note

This function 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.

example

Examples

collapse all

Load lane boundary group data into the workspace.

data = load("laneBoundaryGroupData.mat","lbGroup");

Display the loaded lane boundary group object.

lbGroup = data.lbGroup
lbGroup = 
  laneBoundaryGroup with properties:

      BoundarySegments: [2×1 laneBoundarySegment]
    SegmentConnections: {[1 2]  [4×2 string]}
        BoundaryGroups: [1×5 struct]
          GeoReference: []

Update the segment connections by specifying new boundary mapping. Connect boundary 1 in segment 1 to boundary 1 in segment 2.

lbGroup = updateSegmentConnections(lbGroup,[1 2],{["1","1"]})
lbGroup = 
  laneBoundaryGroup with properties:

      BoundarySegments: [2×1 laneBoundarySegment]
    SegmentConnections: {[1 2]  ["1"    "1"]}
        BoundaryGroups: [1×8 struct]
          GeoReference: []

Plot the lane boundaries. Note the different colors for different lane boundary groups.

plot(lbGroup)

Input Arguments

collapse all

Lane boundary group, specified as a laneBoundaryGroup object.

Pairs of lane boundary segment indices, specified as a P-by-2 matrix. P is the number of lane boundary segment pairs. The lane boundary segment indices are the indices of the lane boundary segment objects in the BoundarySegments property of the input laneBoundaryGroup object lbgroup. For example, a pair [a b] specifies that a lane boundary segment with index a connects to another lane boundary segment with index b.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Lane boundary connections between the lane segments, specified as a P-by-1 cell array. P is the number of lane boundary segment pairs. Each cell 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 segmentPairs, and 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.

Data Types: cell

Output Arguments

collapse all

Updated lane boundary group, returned as a laneBoundaryGroup object.

The returned laneBoundaryGroup object lbgroupUpdated contains the updated connections of the lane boundary segments in the input laneBoundaryGroup object lbgroup.

Version History

Introduced in R2024a