Main Content

addData

Add lane information to lane data object

Since R2023a

Description

example

addData(lanedata,timestamps,lbdata) adds the specified lane information lbdata to the laneData object lanedata.

Examples

collapse all

Create an empty laneData object.

ld = laneData
ld = 
  laneData with properties:

           TimeStamp: []
    LaneBoundaryData: []
     LaneInformation: []
           StartTime: []
             EndTime: []
          NumSamples: 0

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;   % Extract lane boundary information

Add the first five rows of lane information to the laneData object.

addData(ld,t(1:5),lbdata(1:5,:))

Display the details of the laneData object.

disp(ld)
  laneData with properties:

           TimeStamp: [5x1 double]
    LaneBoundaryData: {5x1 cell}
     LaneInformation: []
           StartTime: 0
             EndTime: 0.2000
          NumSamples: 5

Input Arguments

collapse all

Recorded lane data, specified as a laneData object.

Timestamps of lane information to add, specified as an N-element numeric column vector. N is the number of timestamps. Units are in seconds.

When you add lane data, the laneData object automatically arranges 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

Lane boundary data to add, specified as an N-by-M matrix or N-by-1 cell array. N is the number of timestamps.

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 entry 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 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.

Version History

Introduced in R2023a