Hauptinhalt

play

Play track data from actor track data object

Since R2025a

Description

play(trackData) plays the actor track data from the actor track data object trackData on a bird's-eye plot.

example

play(trackData,Name=Value) specifies options using one or more name-value arguments. For example, WaitTime=0.5 plays the actor track data with a 0.5 second delay between data frames.

Note

This function requires the Scenario Builder for Automated Driving Toolbox™ support package. 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 recorded actor track data into the workspace.

load("trackedActorData.mat")

Initialize an ActorTrackData object using the information from the loaded actor track data.

idx = 100;
timestamps = trackedActorData.Timestamps;
trackID = trackedActorData.TrackID;
position = trackedActorData.Position;
trackData = scenariobuilder.ActorTrackData(timestamps(1:idx),trackID(1:idx),position(1:idx))
trackData = 
  ActorTrackData with properties:

                Name: ''

          NumSamples: 100
            Duration: 4.9491
          SampleRate: 20.2058
          SampleTime: 0.0500
          Timestamps: [100×1 double]

             TrackID: {100×1 cell}
            Category: []
            Position: {100×1 cell}
           Dimension: []
         Orientation: []
            Velocity: []
               Speed: []
                 Age: []

          Attributes: []

      UniqueTrackIDs: [6×1 string]
    UniqueCategories: []

Play the actor track data object.

play(trackData)

Add additional data samples to the actor track data object.

add(trackData,timestamps(idx+1:end),trackID(idx+1:end),position(idx+1:end))

Play the actor track data object, and observe the added actor tracks.

play(trackData)

Input Arguments

collapse all

Actor track data, specified as an ActorTrackData object.

Name-Value Arguments

collapse all

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: play(trackData,WaitTime=0.5) plays the actor track data with a 0.5 second delay between data frames.

Parent figure, specified as a Figure object, Axes object, or birdsEyePlot object. If you do not specify Parent, the function plays the track data on a bird's-eye plot in a new figure.

X-axis range of the bird's-eye plot in the vehicle coordinate system, specified as a two-element vector of the form [Xmin Xmax].

The X-axis is vertical, and is positive in the forward direction of the ego vehicle. The origin is at the center of the rear axle of the ego vehicle.

Empty bird's-eye plot with Xmin and Xmax labeled on vertical X-axis

For more details on the coordinate system used in the bird's-eye plot, see Vehicle Coordinate System.

Y-axis range of the bird's-eye plot in the vehicle coordinate system, specified as a two-element vector of the form [Ymin Ymax].

The Y-axis runs horizontally, and is positive to the left of the ego vehicle, as viewed when facing forward. The origin is at the center of the rear axle of the ego vehicle.

Empty bird's-eye plot with Ymin and Ymax labeled on horizontal Y-axis

For more details on the coordinate system used in the birdsEyePlot object, see Vehicle Coordinate System.

Marker fill color, specified as "none", "auto", an RGB triplet, a hexadecimal color code, a color name, or a short color name. The "auto" option uses the same color as the Color property of the parent axes. If you specify "auto" and the axes plot box is invisible, the marker fill color is the color of the figure. For more information, see MarkerFaceColor in the MATLAB® plot function. The "none" option renders the markers without a fill color.

Number of previous actor tracks to display, specified as a nonnegative integer.

Delay between playing actor track frames, specified as a nonnegative scalar. Units are in seconds.

Version History

Introduced in R2025a