Contenuto principale

seek

Seek and plot scenario frame in scenario descriptor

Since R2026a

Description

Add-On Required: This feature requires the Automated Driving Toolbox Test Suite for Euro NCAP Protocols add-on.

seek(scenarioDescriptorPlotObj,simulationTime) plots the scenario frame at the specified scenario simulation time simulationTime of the scenario.

seek(scenarioDescriptorPlotObj,"Collision") plots the first collision instance in the scenario. This syntax also sets the SimulationTime property of the input ScenarioDescriptorPlot object scenarioDescriptorPlotObj to the time of the first collision instance in the scenario simulation.

example

Examples

collapse all

Load a driving scenario containing multiple actor collisions into the workspace.

load("scenarioWithMultipleCollisions.mat")

Create a scenario descriptor from the loaded driving scenario.

scenarioDescriptor = getScenarioDescriptor(sc);

Plot the first frame of the scenario simulation, and create a scenario descriptor plot object from the scenario descriptor object.

scenarioDescriptorPlotObj = plot(scenarioDescriptor)

scenarioDescriptorPlotObj = 
  ScenarioDescriptorPlot with properties:

       SimulationTime: 0
    MaxSimulationTime: 8.0500

       NumDescriptors: 1
        FigureHandles: [1×1 Figure]

            Waypoints: "StartEnd"
             CropType: "None"
               XLimit: []
               YLimit: []
               ZLimit: []
                Title: "Figure"
        SubPlotTitles: "Scenario"
             GridSize: []

Configure the scenario descriptor plot object to change the title.

configure(scenarioDescriptorPlotObj,Title="Collision Scenario")

If you know your scenario contains a collision, you can directly plot the first frame in which a collision occurs. Seek and plot the first collision instance from the loaded scenario.

seek(scenarioDescriptorPlotObj,"Collision")

Rather than specifically plotting the collision instance, you can simulate the scenario, and stop when a collision occurs.

Note: The input scenario contains two collision instances, and the play function stops the simulation at the first collision instance.

play(scenarioDescriptorPlotObj,StopAtEvent="Collision")

Input Arguments

collapse all

Scenario descriptor plot data, specified as a ScenarioDescriptorPlot object.

Simulation time at which to plot the scenario, represented as a nonnegative scalar or an N-element row vector. N is the number of input scenario descriptors. Each value of simulationTime must be less than or equal to the value of the MaxSimulationTime property of the input scenario descriptor plot object scenarioDescriptorPlot.

The simulationTime argument sets the SimulationTime property of the ScenarioDescriptorPlot object.

Data Types: double

Limitations

  • The plot, play, and seek functions displays the lane markings at a junction, which is created without using the roadGroup function.

Version History

Introduced in R2026a