Main Content

laneData

Store recorded lane boundary data with timestamps

Since R2023a

Description

The laneData object stores recorded lane boundary data and associates it with the timestamps at which it was recorded.

Creation

Description

lanedata = laneData creates an empty laneData object lanedata.

example

lanedata = laneData(timestamp,lbdata) creates a laneData object initialized with the recorded lane boundaries lbdata at the associated timestamps timestamp. The timestamp argument sets the TimeStamp property, and the lbdata argument sets the LaneBoundaryData, StartTime, EndTime, and NumSamples properties of the returned laneData object lanedata.

example

lanedata = laneData(___,Name=Value) sets properties using one or more name-value arguments.

Note

This object requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install Scenario Builder for Automated Driving Toolbox from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

Input Arguments

expand all

Lane boundary data, specified as an N-by-M matrix or N-by-1 cell array. N is the number of timestamps. Empty elements represent missing lane boundary detections.

If you have an equal number of recorded lane boundaries across all timestamps, specify lbdata as an N-by-M array of parabolicLaneBoundary objects, cubicLaneBoundary objects, or clothoidLaneBoundary objects. M is the uniform number of detected lane boundaries for each sample.

If you have an unequal number of recorded lane boundaries across timestamps, specify lbdata as an N-by-1 cell array. Each cell must contain an M-element row vector of parabolicLaneBoundary objects, cubicLaneBoundary objects, or clothoidLaneBoundary objects. M is the number of detected lane boundaries at the corresponding timestamp.

The movements of the ego vehicle and non-ego actors must follow the vehicle coordinate system used by Automated Driving Toolbox. For more information on the vehicle coordinate system, see Vehicle Coordinate System.

Note

You must specify all lane boundaries using the same type of object.

Properties

expand all

This property is read-only.

Timestamps of lane boundary information, specified as an N-element numeric column vector. N is the number of timestamps. Each element indicates the time from the start of the simulation, in seconds, at which the associated track was captured.

When you initialize the object with timestamp data, the object arranges the input timestamps in increasing order. If the input data contains multiple rows of data with the same timestamp, the object merges that data into a single row.

Data Types: double

This property is read-only.

Lane boundary data, specified as an N-by-1 cell array. N is the number of timestamps. Each cell contains the lane boundary information recorded at the corresponding timestamp, specified as an M-element row vector of parabolicLaneBoundary objects, cubicLaneBoundary objects, or clothoidLaneBoundary objects. M is the number of detected lane boundaries at the timestamp.

This property is read-only.

Lane information, specified as an N-by-M structure array. N is the number of timestamps. M is the greatest number of lane boundaries detected at any specified timestamp

This property is read-only.

Start time of lane boundary detection, specified as a scalar. Units are in seconds.

Data Types: single | double

This property is read-only.

End time of lane boundary detection, specified as a scalar. Units are in seconds.

Data Types: single | double

This property is read-only.

Number of recorded lane boundary samples, specified as a positive integer.

Data Types: double

Object Functions

readDataRead lane boundary data from laneData object
addDataAdd lane information to lane data object
removeDataRemove data from lane data object
findNearestFind lane information nearest to specified timestamps in lane data object
updateTimeUpdate timestamps of lane data object

Examples

collapse all

Load recorded lane boundary data into the workspace.

data = load("laneBoundaryData.mat");

Extract the recorded timestamps and the lane boundary information from the data.

t = data.timestamps; % Extract timestamps
lbdata = data.lbdata; % Etract lane boundary information

Initialize a laneData object by using the extracted data.

ld = laneData(t,lbdata);

Display the details of the laneData object.

disp(ld) 
  laneData with properties:

           TimeStamp: [1158x1 double]
    LaneBoundaryData: {1158x1 cell}
     LaneInformation: []
           StartTime: 0
             EndTime: 57.8515
          NumSamples: 1158

Load recorded lane boundary data into the workspace.

data = load("laneBoundaryData.mat");

Extract the recorded timestamps, lane boundaries and lane boundary color information from the data.

t = data.timestamps;  % Extract timestamps
lbdata = data.lbdata; % Extract lane boundaries 
lbinfo = data.lbinfo; % Extract lane boundary color information

Initialize a laneData object by using the extracted data, including the additional lane information.

ld = laneData(t,lbdata,LaneInformation=lbinfo);

Display the details of the laneData object.

disp(ld)
  laneData with properties:

           TimeStamp: [1158x1 double]
    LaneBoundaryData: {1158x1 cell}
     LaneInformation: [1158x2 struct]
           StartTime: 0
             EndTime: 57.8515
          NumSamples: 1158

Version History

Introduced in R2023a