identifyActorOfInterest
Syntax
Description
Add-On Required: This feature requires the Automated Driving Toolbox Test Suite for Euro NCAP Protocols add-on.
identifies the IDs of the ego and target actors in the specified scenario descriptor,
actorIDs = identifyActorOfInterest(descriptor)descriptor.
specifies options using one or more name-value arguments. For example,
actorIDs = identifyActorOfInterest(descriptor,Name=Value)ListMotionStatus="On" returns lists of which actors are moving and
which are stationary in the scenario, identified by actor ID.
Examples
Specify the path to your local RoadRunner installation folder. This code shows the path for the default installation location on Windows®.
appPath = "C:\Program Files\RoadRunner R2023b\bin\win64";Specify the path to your RoadRunner project. This code shows the path for a sample project folder location in Windows.
projectPath = "C:\RR\MyProject";Specify the filename of the RoadRunner scenario.
fileName = "TrajectoryCutIn.rrscenario";Set up the environment to open the scenario in RoadRunner. Update the settings group.
To update the MATLAB® path for the RoadRunner installation folder, get the root object within the settings hierarchical tree, and update the TemporaryValue for the RoadRunner installation folder property. For more information, see SettingsGroup.
s = settings; s.roadrunner.application.InstallationFolder.TemporaryValue = appPath;
Open RoadRunner using the specified path to your project. The rrApp RoadRunner object enables you to interact with RoadRunner from the MATLAB workspace.
rrApp = roadrunner(projectPath);
Open the scenario in RoadRunner.
openScenario(rrApp,fileName)
Create a RoadRunner Scenario simulation.
rrSim = createSimulation(rrApp);
Create a structure to store RoadRunner simulation information.
scenario.SimulatorInstance = rrApp; scenario.SimulationInstance = rrSim;
Create a RoadRunner scenario descriptor.
seedScenarioDescriptorRR = getScenarioDescriptor(scenario,Simulator="RoadRunner");Stop the RoadRunner simulation.
close(scenario.SimulatorInstance)
Identify the ego, primary target, and secondary target actors in seedScenarioDescriptorRR.
actorIDs = identifyActorOfInterest(seedScenarioDescriptorRR);
Extract the ego, primary target, and secondary target actor IDs from the actorIDs structure, and display them.
egoID = actorIDs.EgoID
egoID = 2
primaryTargetID = actorIDs.TargetIDs(1)
primaryTargetID = 1
Load a driving scenario into the workspace.
load("scenarioWithMultipleCollisions.mat")Create a ScenarioDescriptor object using the loaded driving scenario scenario.
seedScenarioDescriptor = getScenarioDescriptor(sc,Simulator="DrivingScenario");Specify patterns to identify the ego, primary target, and secondary target actors in seedScenarioDescriptor.
actorIDs = identifyActorOfInterest(seedScenarioDescriptor, ... EgoPattern="go",PrimaryTargetPattern="ped", ... SecondaryTargetPatterns="uck",ListMotionStatus="On");
Extract the ego, primary target, and secondary target actor IDs from the actorIDs structure, and display them.
egoID = actorIDs.EgoID
egoID = 1
primaryTargetID = actorIDs.TargetIDs(1)
primaryTargetID = 2
secondaryTargetID = actorIDs.TargetIDs(2:end)
secondaryTargetID = 3
Input Arguments
Scenario descriptor, specified as a ScenarioDescriptor object. The
ScenarioDescriptor object stores scene, actor, and vehicle
information extracted from a seed scenario, and uses this information to generate
scenario variants. You can use these scenario variants to perform safety assessments for
various automated driving applications.
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: identifyActorOfInterest(descriptor,ListMotionStatus="On")
returns lists of which actors are moving and which are stationary in the scenario,
identified by actor ID.
Name pattern to identify an ego actor in a scenario, specified as a string scalar or a character vector. An ego actor is a vehicle with an installed autonomous driving system.
Data Types: char | string
Name pattern to identify a primary target actor in a scenario, specified as a string scalar or a character vector. A primary target actor is a road user or vehicle other than an ego vehicle that is vulnerable to potential on-road accidents.
Data Types: char | string
Name pattern to identify a secondary target actor in a scenario, specified as a string scalar, character vector, or a cell array of character vectors. A secondary target actor is a road user or vehicle, other than the ego and primary target actors, which is traveling on-road or parked along the route of the ego vehicle. A scenario can contain more than one secondary target actor, and you can specify multiple name patterns by which to identify them by using a cell array of character vectors.
Data Types: char | string | cell
List actor motion status option, specified as "On" or
"Off".
On— Computes the motion status of actors in the scenario. The function outputs the IDs of the moving actors and the stationary actors to the fieldsMovingActorIDsandStationaryActorIDs, respectively, of the output structureactorIDs.Off— The function does not compute the motion status of actors in the scenario, and theactorIDsstructure does not contain theMovingActorIDsandStationaryActorIDsfields.
Data Types: char | string
Output Arguments
Ego and target actor IDs, returned as a structure containing these fields.
| Field | Description |
|---|---|
EgoID | ID of the ego actor, returned as a positive integer. |
TargetIDs | IDs of the primary target and secondary targets, returned as a row vector of positive integers. The value of the first element in the vector specifies the primary target ID, and the rest of the values specify the secondary target IDs. |
MovingActorIDs | IDs of the moving actors, returned as a row vector of positive integers. To enable this field, you must specify
|
StationaryActorIDs | IDs of the stationary actors, returned as a row vector of positive integers. To enable this field, you must specify
|
Version History
Introduced in R2023b
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)