Main Content

actorprops

Generate actor properties from track list

Description

example

actorInfo = actorprops(tracklist,egoTrajectory) generates a table containing actor properties based on the input track list tracklist and ego trajectory data egoTrajectory.

example

actorInfo = actorprops(tracklist,egoTrajectory,AgeThreshold=ageThreshold) excludes actors with age less than the specified age threshold ageThreshold.

Note

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

Examples

collapse all

Load a non-ego actor tracklist, waypoints, and time of arrival for the ego vehicle into the workspace.

data = load("recordedSensorData");

Create a waypointTrajectory object for the ego vehicle.

egoTrajectory = waypointTrajectory(data.egoWaypoints, ...
    data.egoTimeOfArrival,ReferenceFrame="ENU");

Generate and display the actor properties table.

actorInfo = actorprops(data.actorTracklist,egoTrajectory)
actorInfo=18×9 table
    Age    TrackID    ClassID    EntryTime    ExitTime             Mesh               Waypoints           Speed              Yaw      
    ___    _______    _______    _________    ________    ______________________    ______________    ______________    ______________

    138       4          1       0.000383      6.8497     1×1 extendedObjectMesh    {138×3 double}    {138×1 double}    {138×1 double}
    261      13          1       0.000383      13.001     1×1 extendedObjectMesh    {261×3 double}    {261×1 double}    {261×1 double}
     51      22          1       0.000383      2.5007     1×1 extendedObjectMesh    { 51×3 double}    { 51×1 double}    { 51×1 double}
     59      23          1         1.9999      4.8997     1×1 extendedObjectMesh    { 59×3 double}    { 59×1 double}    { 59×1 double}
      6      24          1         3.0507      3.3003     1×1 extendedObjectMesh    {  6×3 double}    {  6×1 double}    {  6×1 double}
     12      25          1         4.6997      5.2497     1×1 extendedObjectMesh    { 12×3 double}    { 12×1 double}    { 12×1 double}
    167      26          1         5.1495      13.451     1×1 extendedObjectMesh    {167×3 double}    {167×1 double}    {167×1 double}
     65      28          1         6.5994      9.7999     1×1 extendedObjectMesh    { 65×3 double}    { 65×1 double}    { 65×1 double}
     31      31          1         9.4507      10.951     1×1 extendedObjectMesh    { 31×3 double}    { 31×1 double}    { 31×1 double}
    377      32          1         11.151      29.951     1×1 extendedObjectMesh    {377×3 double}    {377×1 double}    {377×1 double}
      5      33          1         12.002        12.2     1×1 extendedObjectMesh    {  5×3 double}    {  5×1 double}    {  5×1 double}
    240      37          1         14.049          26     1×1 extendedObjectMesh    {240×3 double}    {240×1 double}    {240×1 double}
      5      38          1           14.3        14.5     1×1 extendedObjectMesh    {  5×3 double}    {  5×1 double}    {  5×1 double}
      5      39          1           14.5        14.7     1×1 extendedObjectMesh    {  5×3 double}    {  5×1 double}    {  5×1 double}
      8      40          1           26.2       26.55     1×1 extendedObjectMesh    {  8×3 double}    {  8×1 double}    {  8×1 double}
     16      42          1         27.101       27.85     1×1 extendedObjectMesh    { 16×3 double}    { 16×1 double}    { 16×1 double}
      ⋮

Load a non-ego actor tracklist, waypoints, and time of arrival for the ego vehicle into the workspace.

data = load("recordedSensorData");

Create a waypointTrajectory object for the ego vehicle.

egoTrajectory = waypointTrajectory(data.egoWaypoints, ...
    data.egoTimeOfArrival);

Generate the actor properties table without specifying an age threshold.

actorInfo1 = actorprops(data.actorTracklist,egoTrajectory);

Generate an actor properties table with a speified age threshold.

actorInfo2 = actorprops(data.actorTracklist,egoTrajectory, ...
    AgeThreshold=20);

Display the number of actors in each property table. The number of actors in actorInfo2 is less as compared to the number of actors in actorInfo1.

numActorsInActorInfo1 = numel(actorInfo1.TrackID)
numActorsInActorInfo1 = 18
numActorsInActorInfo2 = numel(actorInfo2.TrackID)
numActorsInActorInfo2 = 10

Input Arguments

collapse all

Actor track list information, specified as a K-by-2 table. Each row in the table represents track information relative to its time.

The first column of the table must contain timestamps at which the track information was captured, specified as a positive scalar. Units are in seconds.

The second column of the table must contain track information of non-ego actors, specified as an M-by-1 structure. M is the number of actors. The structure must contain these fields:

FieldDescription
TrackIDTrack ID of the actor, specified as a numeric scalar, string scalar, or a character vector.
ClassID

Classification identifier of the actor, specified as one of these nonnegative integers:

  • 1 — Car

  • 2 — Truck

  • 3 — Bicycle

  • 4 — Pedestrian

  • 0 — Others

Position

Position of the actor with respect to the ego frame, specified as a 3-element numeric row vector of the form [x y z]. Units are in meters.

The structure can also contain these optional fields:

FieldDescription
Dimension

Dimensions of the actor, specified as a 3-element numeric row vector of the form [length width height].

Units are in meters.

Yaw

Yaw angle of the actor with respect to the ego frame, specified as a scalar.

Units are in degrees.

Speed

Speed of the actor with respect to the ego frame, specified as a scalar.

Units are in meters per second.

Velocity

Velocity of the actor with respect to the ego frame, specified as a 3-element numeric row vector of the form [vx vy vz].

Units are in meters per second.

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 vehicle coordinate system, see Vehicle Coordinate System.

Ego trajectory information, specified as a waypointTrajectory object.

Actor age threshold, specified as a positive integer. The returned actorInfo table excludes the actors with age less than the specified ageThreshold value.

Output Arguments

collapse all

Actor trajectory information, returned as a table. The trajectory parameters are in the world coordinate frame. Each row in the table represents the trajectory parameters of an actor.

The table contain these columns.

ColumnDescription
AgeAge of the actor, returned as a positive integer. This value specifies the number of times the actor has been tracked.
TrackID

Track ID of the actor, returned as a numeric scalar, string scalar, or a character vector.

ClassIDActor classification identifier, returned as a nonnegative integer. Values are in the range 0 to 4.
EntryTimeEntry time of the actor, returned as a positive scalar. This value specifies the time of first detection of an actor. Units are in seconds.
ExitTimeExit time of the actor, returned as a positive scalar. This value specifies the time of last detection of an actor. Units are in seconds.
Mesh

Mesh assigned to the actor, returned as an extendedObjectMesh object.

WaypointsWaypoints of the actor center in the world frame from entry time to exit time, returned as an N-by-3 matrix. N is the number of waypoints. Units are in meters.
SpeedSpeeds of the actor in the world frame from entry time to exit time, returned as an N-element column vector. Speed values are relative to the corresponding values of Waypoints. Units are in meters per second.
YawYaw angles of the actor in the world frame from entry time to exit time, returned as an N-element column vector. Yaw values are relative to the corresponding values of Waypoints. Units are in degrees.
Dimension

Dimensions of the actor, returned as a 3-element numeric row vector of the form [length width height]. Units are in meters.

Dependencies

This column is optional, and appears in the table only if tracklist contains the dimension information of the actor.

Version History

Introduced in R2022b