Main Content

laneBoundarySegment

Store lane boundary information of road segment

Since R2024a

Description

The laneBoundarySegment object stores lane boundary information for a road segment, in world coordinates.

Creation

Description

lbsegment = laneBoundarySegment(boundaryIDs,boundaryPoints) creates a laneBoundarySegment object, lbsegment, initialized with boundary points boundaryPoints for its associated boundary IDs boundaryIDs. The boundaryIDs argument sets the BoundaryIDs property, and the boundaryPoints argument sets the BoundaryPoints property, of the returned laneBoundarySegment object lbsegment.

example

lbsegment = laneBoundarySegment(___,Name=Value) sets properties using one or more name-value arguments, in addition to the input arguments from the previous syntax.

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.

example

Properties

expand all

This property is read-only.

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

This property is read-only.

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.

  • 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

Additional lane boundary information, specified as an N-by-1 structure array. N is the number of lane boundaries.

Data Types: struct

This property is read-only.

Number of lane boundaries, stored as a positive integer equal to the number of cells in the BoundaryPoints property.

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

This property is read-only.

Number of lane boundary points, stored as a positive integer. This value is the total number of points in the BoundaryPoints property.

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

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
resamplePointsResample lane boundary points
smoothBoundariesSmooth lane boundaries
addBoundariesAdd lane boundaries to lane boundary segment object
removeBoundariesRemove lane boundaries from lane boundary segment object
updateBoundaryPointsUpdate lane boundary points of existing lane boundaries
updateBoundaryIDsUpdate IDs of lane boundaries in lane boundary segment object
alignBoundaryPointsAlign lane boundary points in lane boundary segment object

Examples

collapse all

Load lane boundary data into the workspace.

data = load("laneBoundarySegmentData.mat","ids","points");

Display the lane boundary IDs and their associated lane boundary points.

boundaryIDs = data.ids
boundaryIDs = 4×1 string
    "3"
    "1"
    "2"
    "4"

boundaryPoints = data.points
boundaryPoints=4×1 cell array
    {128×3 double}
    {128×3 double}
    {128×3 double}
    {128×3 double}

Create a lane boundary segment objec.

lbsegment = laneBoundarySegment(boundaryIDs,boundaryPoints)
lbsegment = 
  laneBoundarySegment with properties:

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

Load lane boundary data into the workspace.

data = load("laneBoundarySegmentData.mat","ids","points","info");

Display the lane boundary IDs, their associated lane boundary points, and the additional lane information.

boundaryIDs = data.ids
boundaryIDs = 4×1 string
    "3"
    "1"
    "2"
    "4"

boundaryPoints = data.points
boundaryPoints=4×1 cell array
    {128×3 double}
    {128×3 double}
    {128×3 double}
    {128×3 double}

boundaryInfo = data.info
boundaryInfo=4×1 struct array with fields:
    Type

Specify the geographic coordinates of the lane boundary origin.

geoRef = [0 0 0];

Create a lane boundary segment object that includes the additional lane information and geographic origin.

lbsegment = laneBoundarySegment(boundaryIDs,boundaryPoints,BoundaryInfo=boundaryInfo,GeoReference=geoRef)
lbsegment = 
  laneBoundarySegment with properties:

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

Tips

Algorithms

  • The first point of a lane boundary represents the start of the lane segment, and the last lane boundary point represents the end of the lane segment.

  • If the specified lane boundaries do not all have equal numbers of points, then the laneBoundarySegment object resamples the lane boundaries so they all have the same number of points as the specified boundary with the greatest number of points.

  • This object uses the Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) method to interpolate the lane boundary points by using the pchip function. If the x- or y-coordinate values of the lane boundary points do not increase or decrease monotonically, then the PCHIP fit might produce an unrealistic lane boundary shape.

Version History

Introduced in R2024a