addData
Description
Add-On Required: This feature requires the Scenario Builder for Automated Driving Toolbox add-on.
addData(
adds the specified track ID data trackdata,timestamps,trackID,classID,position)trackID, class ID data
classID, and position data position with the
corresponding timestamps timestamps to the actorTracklist
object trackdata.
addData(___, specifies
additional options using name-value arguments, in addition to all input arguments from the
previous syntax. For example, Name=Value)Velocity={[4 1 0; 2 2 1]} adds velocities
of the form [vx
vy
vz] for two actors at one timestamp.
Examples
Create an empty actorTracklist object.
actorObject = actorTracklist
actorObject =
actorTracklist with properties:
TimeStamp: []
TrackIDs: []
ClassIDs: []
Position: []
Dimension: []
Orientation: []
Velocity: []
Speed: []
StartTime: []
EndTime: []
NumSamples: 0
UniqueTrackIDs: []
Load recorded actor track list data into the workspace.
data = load("actorTracklistData.mat");Extract the recorded timestamps and the actor track IDs, class IDs, and position information from the data.
t = data.timestamps; % Extract timestamps trackids = data.actorTrackIDs; % Extract track IDs classids = data.actorClassIDs; % Extract class IDs pos = data.actorPosition; % Extract position information
Add the first five rows of data to the empty actorTracklist object.
addData(actorObject,t(1:5),trackids(1:5),classids(1:5),pos(1:5))
Display the details of the actorTracklist object.
disp(actorObject)
actorTracklist with properties:
TimeStamp: [5×1 double]
TrackIDs: {5×1 cell}
ClassIDs: {5×1 cell}
Position: {5×1 cell}
Dimension: []
Orientation: []
Velocity: []
Speed: []
StartTime: 3.8300e-04
EndTime: 0.2003
NumSamples: 5
UniqueTrackIDs: [3×1 string]
Input Arguments
Actor track list information, specified as an actorTracklist object.
Recording timestamps of track information to add, specified as a scalar or an N-element column vector. N is the number of timestamps. Units are in seconds.
Data Types: single | double
Track IDs of the actors, specified as an N-by-1 string array or an N-by-1 cell array. N is the number of timestamps for which you are adding information.
For a single recorded actor across each timestamp, specify
trackID as an N-by-1 string array.
For a multiple recorded actors across each timestamp, specify
trackID as an N-by-1 cell array. Each cell
contains the track IDs of the actors to add at the corresponding timestamp, specified as
a 1-by-M string array. M is the number of actors
at the timestamp.
Classification IDs of the actors, specified as an N-element column vector or an N-by-1 cell array. N is the number of timestamps for which you are adding information.
For a single recorded actor across each timestamp, specify
classID as an N-by-1 vector.
For a multiple recorded actors across each timestamp, specify
classID as an N-by-1 cell array. Each cell
contains the class IDs of the detected actors to add at the corresponding timestamp,
specified as an M-element row vector of nonnegative integers.
M is the number of actors at the timestamp.
You must specify each class ID as one of these nonnegative integers:
1— Car2— Truck3— Bicycle4— Pedestrian0— Others
Positions of actors with respect to the ego frame, specified as an N-by-1 cell array. N is the number of timestamps for which you are adding information. Each cell contains the positions of the actors detected at the corresponding timestamp, specified as an M-by-3 numeric matrix. M is the number of actors at the timestamp. Each row specifies the position of an actor in the form [x y z]. Units are in meters.
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: addData(trackdata,timestamps,trackID,classID,position,Velocity={[4 1 0;
2 2 1]}) adds velocities of the form [vx
vy
vz] for two actors at one timestamp.
Dimensions of the actors, specified as an N-by-1 cell array. N is the number of timestamps for which you are adding information. Each cell contains the dimensions of the actors detected at the corresponding timestamp, specified as an M-by-3 numeric matrix. M is the number of actors at the timestamp. Each row specifies the dimension of an actor in the form [length width height]. Units are in meters.
Orientations of the actors, specified as an N-by-1 cell array. N is the number of timestamps for which you are adding information. Each cell contains the orientations of the actors detected at the corresponding timestamp, specified as an M-by-3 numeric matrix. M is the number of actors at the timestamp. Each row specifies the orientation of an actor in the form [yaw pitch roll]. Units are in degrees.
Speeds of the actors with respect to the ego frame, specified as an N-by-1 cell array. N is the number of timestamps for which you are adding information. Each cell contains the speeds of the actors detected at the corresponding timestamp, specified as an M-element numeric row vector. M is the number of actors at the timestamp. Units are in meters per second.
Velocities of the actors with respect to the ego frame, specified as an N-by-1 cell array. N is the number of timestamps for which you are adding information. Each cell contains the velocities of the actors detected at the corresponding timestamp, specified as an M-by-3 numeric matrix. M is the number of actors at a timestamp. Each row specifies the velocity of an actor in the form [vx vy vz]. Units are in meters per second.
Version History
Introduced in R2023a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)