Main Content

egoToWorldLaneBoundarySegments

Convert tracked lane boundaries to lane boundary segments in world coordinates

Since R2024a

Description

example

lbsegments = egoToWorldLaneBoundarySegments(trackedLaneBoundaries,egoTrajectory) converts the input tracked lane boundaries trackedLaneBoundaries in ego vehicle coordinates into an array of laneBoundarySegment objects lbsegments in world coordinates by using the ego trajectory information egoTrajectory.

lbsegments = egoToWorldLaneBoundarySegments(trackedLaneBoundaries,egoPose) converts the tracked lane boundaries to an array of laneBoundarySegment objects lbsegments in world coordinates by using the ego pose information egoPose.

example

lbsegments = egoToWorldLaneBoundarySegments(___,Name=Value) specifies options using one or more name-value arguments in addition to any combination of input arguments from previous syntaxes. For example, MergeSegments=False returns lane boundary segments for each valid input frame of the lane data without merging the lane boundaries with the same lane boundary IDs.

Note

This function requires the Scenario Builder for Automated Driving Toolbox™ support package and Sensor Fusion and Tracking Toolbox™. 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.

Examples

collapse all

Load tracked lane boundary data and ego trajectory data into the workspace.

data = load("recordedLaneTracks","trackedLaneBoundaries","egoTrajectory")
data = struct with fields:
    trackedLaneBoundaries: [1×1 laneData]
            egoTrajectory: [1×1 waypointTrajectory]

Create lane boundary segments by converting the lane boundaries from ego vehicle coordinates to world coordinates by using ego trajectory data. The egoToWorldLaneBoundarySegments function creates three lane boundary segments from the lane boundary data.

lbsegments = egoToWorldLaneBoundarySegments(data.trackedLaneBoundaries,data.egoTrajectory);

Display the first lane boundary segment.

lbsegments(1)
ans = 
  laneBoundarySegment with properties:

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

Load tracked lane boundary data and ego trajectory data into the workspace.

data = load("recordedLaneTracks","trackedLaneBoundaries","egoTrajectory")
data = struct with fields:
    trackedLaneBoundaries: [1×1 laneData]
            egoTrajectory: [1×1 waypointTrajectory]

Convert the lane boundaries from ego vehicle coordinates to world coordinates, without merging lane boundaries, by using the ego trajectory data. The egoToWorldBoundarySegements function creates 79 lane boundary segments from the lane boundary data.

lbsegments = egoToWorldLaneBoundarySegments(data.trackedLaneBoundaries,data.egoTrajectory,MergeSegments=false);

Display the first lane boundary segment.

lbsegments(1)
ans = 
  laneBoundarySegment with properties:

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

Input Arguments

collapse all

Tracked lane boundary data, specified as a laneData object.

Note

The laneData object must contain the track IDs of the lane boundaries, specified as the TrackIDs property, for each timestamp.

Ego trajectory information, specified as a waypointTrajectory (Sensor Fusion and Tracking Toolbox) object.

Ego pose information, specified as an N-element vector of rigidtform3d objects. N is the number of timestamps in trackedLaneBoundaries.

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: egoToWorldLaneBoundarySegments(trackedLaneBoundaries,egoTrajectory,MergeSegments=False) returns lane boundary segments for each valid input frame of the lane data without merging the lane boundaries with the same lane boundary IDs.

Lane boundary merging, specified as a logical 1 (true) or 0 (false).

By default, the function merges the input lane boundaries with the same lane boundary IDs to create lane boundary segments. In this case, the function returns fewer lane boundary segments than the number of timestamps in the input trackedLaneBoundaries.

If you specify this argument as false, the function does not merge lane boundaries, and returns N lane boundary segments. N is the number timestamps in the input trackedLaneBoundaries.

Data Types: logical

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 are with respect to the WGS84 reference ellipsoid, which is a standard ellipsoid used by GPS data.

Data Types: single | double

Output Arguments

collapse all

Lane boundary segments, returned as a laneBoundarySegment object or an M-by-1 array of laneBoundarySegment objects. M is the number of segments created by the egoToWorldLaneBoundarySegments function.

Note

The frequency of the lane boundary track ID variations in the input laneData object, trackedLaneBoundaries, determines the number of output lane boundary segments M.

Tips

  • To group adjacent lane boundary segments using boundary connections, use the laneBoundaryGroup object.

Algorithms

  • If the ego vehicle is stationary for multiple, sequential timestamps, then this function skips the rows of the input laneData object that specify lane information redundant to the first stationary timestamp.

  • For the last row of the input laneData object, this function assumes the distance of the lane boundary from the center of the ego vehicle is 5 meters.

Version History

Introduced in R2024a