Main Content

updateBoundaryPoints

Update lane boundary points of existing lane boundaries

Since R2024a

Description

lbsegmentUpdated = updateBoundaryPoints(lbsegment,boundaryIDs,newPoints) updates the points of the existing lane boundaries boundaryIDs, in the laneBoundarySegment object lbsegment, with the new lane boundary points newPoints, and returns an updated laneBoundarySegment object, lbsegmentUpdated.

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 segment data into the workspace.

data = load("laneBoundarySegmentData.mat","lbsegment");

Display the loaded lane boundary segment object.

lbsegment = data.lbsegment
lbsegment = 
  laneBoundarySegment with properties:

       BoundaryIDs: [4×1 string]
    BoundaryPoints: {4×1 cell}
      BoundaryInfo: []
     NumBoundaries: 4
         NumPoints: 128
      GeoReference: []

Display the first few boundary points of the lane boundary with ID 3.

index = find(lbsegment.BoundaryIDs=="3");
head(lbsegment.BoundaryPoints{index,1})
 -260.9682  208.4030   35.4009
 -259.7478  207.9757   35.4009
 -260.9682  208.4030   35.4009
 -259.7478  207.9757   35.4009
 -258.5299  207.4916   35.3578
 -257.3119  207.0687   35.3578
 -256.0966  206.5887   34.9571
 -254.8760  206.1639   34.9571

Shift the x-coordinate values of the lane boundary with ID 3 by 10 meters.

newPoints = {lbsegment.BoundaryPoints{1} + [10 0 0]};
lbsegment = updateBoundaryPoints(lbsegment,"3",newPoints);

Display the first few boundary points of the updated lane boundary.

head(lbsegment.BoundaryPoints{index,1})
 -250.9682  208.4030   35.4009
 -249.7478  207.9757   35.4009
 -250.9682  208.4030   35.4009
 -249.7478  207.9757   35.4009
 -248.5299  207.4916   35.3578
 -247.3119  207.0687   35.3578
 -246.0966  206.5887   34.9571
 -244.8760  206.1639   34.9571

Input Arguments

collapse all

Lane boundary segment, specified as a laneBoundarySegment object.

Lane boundary IDs, specified as an N-by-1 string array. N is the number of lane boundaries.

Note

Each lane boundary ID value must be unique.

Data Types: string

New lane boundary points, specified as an N-by-1 cell array. N is the number of lane boundaries. Each cell contains a P-by-2 or P-by-3 matrix. P is the number of points for each lane boundary, and it must be greater than one.

  • If a matrix is a P-by-2 matrix, then each row represents the xy-coordinates of a lane boundary point. The z-coordinate of each lane boundary point is 0.

  • If a matrix is a P-by-3 matrix, then each row represents the xyz-coordinates of a lane boundary point.

Note

  • The x- or y-coordinate values of the lane boundary points stored in a matrix must increase or decrease monotonically.

  • Lane boundaries must be in left-to-right order with respect to the travel direction of the lane.

Data Types: cell

Output Arguments

collapse all

Updated lane boundary segment, returned as a laneBoundarySegment object.

The returned laneBoundarySegment object lbsegmentUpdated contains the updated lane boundary points for the lane boundaries in the input laneBoundarySegment object lbsegment.

Version History

Introduced in R2024a