ncapScenario
Syntax
Description
generates a seed scenario descriptor, descriptor
= ncapScenario(ncapTestName
)descriptor
, for the input
European New Car Assessment Programme (Euro NCAP®)
test name ncapTestName
.
[
generates seed scenario descriptors for all scenarios for the specified test name, and
returns the scenario information descriptor
,scenarioInfo
] = ncapScenario(ncapTestName
,AllScenarios=true)scenarioInfo
.
[___] = ncapScenario(___,
specifies options using one or more name-value arguments, in addition to any combination of
arguments from previous syntaxes. For example, Name=Value
)ShowProgress="GUI"
displays the scenario generation progress bar in a graphical user interface.
Note
This function requires the Automated Driving Toolbox™ Test Suite for Euro NCAP® Protocols support package. You can install the Automated Driving Toolbox Test Suite for Euro NCAP Protocols support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
To use the
EgoAssetInfo
name-value argument, you must install RoadRunner and activate your RoadRunner license interactively. For more information, see Install and Activate RoadRunner (RoadRunner).
Examples
Generate RoadRunner Seed Scenario Using Euro NCAP Test Name
Specify the European New Car Assessment Programme (Euro NCAP) test name for the Vulnerable Road User Automatic Emergency Braking Crossing Car-to-Pedestrian Nearside Child Obstructed test.
ncapTestName = "VRU AEB Crossing CPNCO";
Generate a seed scenario descriptor for the NCAP test, which you can use to create its variants.
descriptor = ncapScenario(ncapTestName);
To visualize the created scenario, specify the path to your local RoadRunner installation folder. This code shows the path for the default installation location of RoadRunner R2024a on Windows®.
appPath = "C:\Program Files\RoadRunner R2024a\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";
Set up the environment for opening the scenario in RoadRunner. Update the settings group.
s = settings; s.roadrunner.application.InstallationFolder.TemporaryValue = appPath;
Open RoadRunner using the specified path to your project, and get the ScenarioSimulation
object from your scenario.
rrApp = roadrunner(projectPath);
scenario = getScenario(descriptor,Simulator="RoadRunner",SimulatorInstance=rrApp);
Simulate Scenarios in RoadRunner Using Euro NCAP Test Name
Specify the Euro NCAP test name for the Safety Assist Automatic Emergency Braking Car-to-Car Front head-on lane change scenario.
ncapTestName = "SA AEB CCFhol";
Specify the path to your RoadRunner ego asset.
egoAssetInfo.AssetPath = "Vehicles/DeliveryVan.fbx_rrx.rrmeta";
Generate an array of scenario descriptors and their scenario information for the specified Euro NCAP test name.
[descriptors,scenarioInfo] = ncapScenario(ncapTestName,AllScenarios=true,EgoAssetInfo=egoAssetInfo);
SA AEB CCFhol Progress: (100%)[==================================================]( 2/ 2)
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 R2024b\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";
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);
Specify a valid index for a scenario descriptor object.
idx = 1;
Create a RoadRunner scenario for the scenario descriptor object at the specified index.
scenario = getScenario(descriptors(idx),Simulator="RoadRunner",SimulatorInstance=rrApp);
This figure shows an instance of the simulated Safety Assist Automatic Emergency Braking Car-to-Car Front head-on lane change scenario in RoadRunner, which contains an ego vehicle represented as a blue delivery van.
Input Arguments
ncapTestName
— Euro NCAP test scenario name
"valid Euro NCAP test scenario name"
Euro NCAP test scenario name, specified as
one of the ncapTestName
values listed in the Euro NCAP Test Scenario Information section.
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:
ncapScenario(ncapTestName,AllScenarios=true,ShowProgress="GUI")
displays
the scenario generation progress bar in a graphical user interface.
ShowProgress
— Show progress bar
"CommandLine"
(default) |
"GUI"
| "No"
Show the progress bar, specified as one of these options:
"CommandLine"
— Displays the scenario generation progress bar in the MATLAB® Command Window."GUI"
— Displays the scenario generation progress bar in a graphical use interface (GUI)."No"
— Does not displays the progress bar.
EgoAssetInfo
— Ego asset information
structure
Ego asset information, specified as a structure. The structure contains these fields:
Field | Description |
---|---|
AssetPath | Ego asset path, specified as a string scalar. The value must be a valid RoadRunner asset path for an ego vehicle. |
Dimension | Dimensions of the ego asset, specified as a structure with these fields:
|
Note
To use the EgoAssetInfo
name-value argument, you must also
specify AllScenarios=true
to the
ncapScenario
function.
Output Arguments
descriptor
— Scenario descriptors
ScenarioDescriptor
object | N-element array of ScenarioDescriptor
objects
Scenario descriptors, returned as a ScenarioDescriptor
object or an
N-element array of ScenarioDescriptor
objects.
If you specify AllScenarios=true
to the
ncapScenario
function, the function returns an
N-element array of ScenarioDescriptor
objects.
N is the number of generated scenario descriptors for a specified
Euro NCAP test name. Otherwise, the function
returns a single ScenarioDescriptor
object that represents the seed
scenario for a specified Euro NCAP test
name.
Each ScenarioDescriptor
object stores the scene, actor, and vehicle
information of a seed scenario. You can use this information to generate scenario
variants for performing safety assessments for various automated driving
applications.
By default, the function specifies the ego vehicle as a sedan in the returned
scenario descriptor object, and fixes the dimensions of the sedan to
[4.5556
1.9378
1.4538
0.8940
0.9483
2.7133
] in the form [length
width
height
frontOverhang
rearOverhang
wheelbase
]. Units are in meters. For more information on actor
dimensions, see Actor and Vehicle Positions and Dimensions.
scenarioInfo
— Scenario information
structure
Scenario information, returned as a structure. The structure contains these fields:
Field | Description |
---|---|
ValidScenario | Valid scenario flag, returned as |
Messages | Messages and warnings related to the generated scenarios, returned as a string scalar or character vector. The
|
BehaviorUnderTest | Behavioral safety assessment test parameters, returned as a structure with these fields:
|
EventTime | Time at which an event occurs, returned as a scalar. For example, for a collision event, this field represents the time at which the collision occurs. Units are in seconds. |
EgoTrajectory | Trajectory information of the ego vehicle, returned as a structure with these fields:
|
Note
To return the scenarioInfo
output argument, you must also
specify AllScenarios=true
to the ncapScenario
function.
More About
Euro NCAP Test Scenario Information
These tables lists the full names of Euro
NCAP test scenarios, their corresponding
ncapTestName
values, their descriptions, and their
location in the Euro NCAP test protocol
document.
Car-to-Car Collision Scenarios
ncapTestName | Euro NCAP Test Scenario Full Name | Description | Euro NCAP Test Protocol Document |
---|---|---|---|
"SA AEB CCRs" | Safety Assist Automatic Emergency Braking Car-to-Car Rear stationary | The ego vehicle moves forward toward a stationary target vehicle, resulting in a collision between the front side of the ego and the rear side of the target. | For more information on this test, see page 16 of the Euro NCAP Test Protocol document. |
"SA AEB CCRm" | Safety Assist Automatic Emergency Braking Car-to-Car Rear moving | The ego vehicle moves forward toward a target vehicle traveling at a constant speed, resulting in a collision between the front side of the ego and the rear side of the target. | For more information on this test, see page 17 of the Euro NCAP Test Protocol document. |
"SA AEB CCRb" | Safety Assist Automatic Emergency Braking Car-to-Car Rear braking | The ego vehicle moves forward toward a target vehicle traveling at a constant speed, collides, and then decelerates, resulting in a collision between the front side of the ego and the rear side of the target. | For more information on this test, see page 17 of the Euro NCAP Test Protocol document. |
"SA AEB CCFtap" | Safety Assist Automatic Emergency Braking Car-to-Car Front turn across path | The ego vehicle turns across the path of an oncoming target vehicle traveling at a constant speed, resulting in a head-on collision. | For more information on this test, see page 18 of the Euro NCAP Test Protocol document. |
"SA AEB CCCscp" | Safety Assist Automatic Emergency Braking Car-to-Car Crossing straight crossing path | The ego and target vehicles move toward a junction on straight, perpendicular paths, resulting in a collision between the front side of the ego and one side of the target. | For more information on this test, see page 19 of the Euro NCAP Test Protocol document. |
"SA AEB CCFhos" | Safety Assist Automatic Emergency Braking Car-to-Car Front head-on straight | The ego and target vehicles move toward each other on a same lane, resulting in a head-on collision. | For more information on this test, see page 22 of the Euro NCAP Test Protocol document. |
"SA AEB CCFhol" | Safety Assist Automatic Emergency Braking Car-to-Car Front head-on lane change | The ego and target vehicles move toward each other, each traveling on different lanes. The target vehicle performs a lane change into the ego lane, resulting in a head-on collision. | For more information on this test, see page 22 of the Euro NCAP Test Protocol document. |
Car-to-Pedestrian Collision Scenarios
ncapTestName | Euro NCAP Test Scenario Full Name | Description | Euro NCAP Test Protocol Document |
---|---|---|---|
"VRU AEB Crossing CPFA" | Vulnerable Road User Automatic Emergency Braking Crossing Car-to-Pedestrian Farside Adult | The ego vehicle moves forward toward an adult pedestrian running across its path from the farside, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 24 of the Euro NCAP Test Protocol document. |
"VRU AEB Crossing CPNA" | Vulnerable Road User Automatic Emergency Braking Crossing Car-to-Pedestrian Nearside Adult | The ego vehicle moves forward toward an adult pedestrian walking across its path from the nearside, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 24 of the Euro NCAP Test Protocol document. |
"VRU AEB Crossing CPNCO" | Vulnerable Road User Automatic Emergency Braking Crossing Car-to-Pedestrian Nearside Child Obstructed | The ego vehicle moves forward toward an child pedestrian walking across its path from the nearside, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 25 of the Euro NCAP Test Protocol document. |
"VRU AEB Longitudinal
CPLA" | Vulnerable Road User Automatic Emergency Braking Longitudinal Car-to-Pedestrian Longitudinal Adult | The ego vehicle moves forward toward an adult pedestrian walking in front, in the same direction, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 25 of the Euro NCAP Test Protocol document. |
"VRU AEB Turning CPTAns" | Vulnerable Road User Automatic Emergency Braking Turning Car-to-Pedestrian Turning Adult nearside same | The ego vehicle moves forward toward an adult pedestrian crossing its path, starting in the same direction, walking across a junction from the nearside, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 27 of the Euro NCAP Test Protocol document. |
"VRU AEB Turning CPTAno" | Vulnerable Road User Automatic Emergency Braking Car-to-Pedestrian Turning Adult nearside opposite | The ego vehicle moves forward toward an adult pedestrian crossing its path, starting in the opposite direction, walking across a junction from the nearside, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 27 of the Euro NCAP Test Protocol document. |
"VRU AEB Turning CPTAfs" | Vulnerable Road User Automatic Emergency Braking Turning Car-to-Pedestrian Turning Adult farside same | The ego vehicle moves forward toward an adult pedestrian crossing its path, starting in the same direction, walking across a junction from the farside, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 26 of the Euro NCAP Test Protocol document. |
"VRU AEB Turning CPTAfo" | Vulnerable Road User Automatic Emergency Braking Turning Car-to-Pedestrian Turning Adult farside opposite | The ego vehicle moves forward toward an adult pedestrian crossing its path, in the opposite direction, walking across a junction from the farside, resulting in a collision between the front side of the ego vehicle and the pedestrian. | For more information on this test, see page 27 of the Euro NCAP Test Protocol document. |
"VRU AEB Reverse CPRs" | Vulnerable Road User Automatic Emergency Braking Reverse Car-to-Pedestrian Reverse stationary | The ego vehicle moves rearward toward an adult or child pedestrian standing still, resulting in a collision between the rear side of the ego vehicle and the pedestrian. | For more information on this test, see page 29 of the Euro NCAP Test Protocol document. |
"VRU AEB Reverse CPRm" | Vulnerable Road User Automatic Emergency Braking Reverse Car-to-Pedestrian Reverse moving | The ego vehicle moves rearward toward an adult or child pedestrian walking from the nearside, resulting in a collision between the rear side of the ego vehicle and the pedestrian. | For more information on this test, see page 29 of the Euro NCAP Test Protocol document. |
Car-to-Motorcyclist Collision Scenarios
ncapTestName | Euro NCAP Test Scenario Full Name | Description | Euro NCAP Test Protocol Document |
---|---|---|---|
"VRU AEB Longitudinal
CMRs" | Vulnerable Road User Automatic Emergency Braking Longitudinal Car-to-Motorcyclist Reverse stationary | The ego vehicle moves forward toward a motorcyclist in front, traveling in the same direction. It results in a collision between the front side of the ego vehicle and the rear side of the motorcyclist. | For more information on this test, see page 36 of the Euro NCAP Test Protocol document. |
"VRU AEB Longitudinal
CMRb" | Vulnerable Road User Automatic Emergency Braking Longitudinal Car-to-Motorcyclist Reverse braking | The ego vehicle moves forward toward a motorcyclist in front, traveling in the same direction at a constant speed, which then decelerates, resulting in a collision between the front side of the ego and the rear side of the motorcyclist. | For more information on this test, see page 37 of the Euro NCAP Test Protocol document. |
"VRU AEB Turning CMFtap" | Vulnerable Road User Automatic Emergency Braking Turning Car-to-Motorcyclist Front turn across path | The ego vehicle turns across the path of an oncoming motorcyclist that travels at a constant speed, resulting in a collision between the front side of the ego vehicle and the front side of the motorcyclist. | For more information on this test, see page 38 of the Euro NCAP Test Protocol document. |
"VRU AEB Lateral CM
Oncoming" | Vulnerable Road User Automatic Emergency Braking Lateral Car-to-Motorcyclist Oncoming | The ego vehicle drifts out of lane toward a motorcyclist traveling in the opposite direction, resulting in a collision between the front side of the ego vehicle and the front side of the motorcyclist. | For more information on this test, see page 39 of the Euro NCAP Test Protocol document. |
"VRU AEB Lateral CM Overtaking
unintentional" | Vulnerable Road User Automatic Emergency Braking Lateral Car-to-Motorcyclist Overtaking unintentional | The ego vehicle unintentionally overtakes a motorcyclist traveling in the same direction on a lane adjacent to the driver side of the ego vehicle. | For more information on this test, see page 41 of the Euro NCAP Test Protocol document. |
"VRU AEB Lateral CM Overtaking
intentional" | Vulnerable Road User Automatic Emergency Braking Lateral Car-to-Motorcyclist Overtaking intentional | The ego vehicle intentionally overtakes a motorcyclist traveling in the same direction on a lane adjacent to the driver side of the ego vehicle. | For more information on this test, see page 41 of the Euro NCAP Test Protocol document. |
Car-to-Bicyclist Collision Scenarios
ncapTestName | Euro NCAP Test Scenario Full Name | Description | Euro NCAP Test Protocol Document |
---|---|---|---|
"VRU AEB Crossing CBFA" | Vulnerable Road User Automatic Emergency Braking Crossing Car-to-Bicyclist Farside Adult | The ego vehicle moves forward toward a bicyclist crossing its path cycling from the farside, resulting in a collision between the front side of the ego vehicle and the bicyclist. | For more information on this test, see page 30 of the Euro NCAP Test Protocol document. |
"VRU AEB Crossing CBNA" | Vulnerable Road User Automatic Emergency Braking Crossing Car-to-Bicyclist Nearside Adult | The ego vehicle moves forward toward a bicyclist crossing its path cycling from the nearside, resulting in a collision between the front side of the ego vehicle and the bicyclist. | For more information on this test, see page 31 of the Euro NCAP Test Protocol document. |
"VRU AEB Crossing CBNAO" | Vulnerable Road User Automatic Emergency Braking Crossing Car-to-Bicyclist Nearside Adult Obstructed | The ego vehicle moves forward toward a bicyclist crossing its path cycling from the nearside from behind an obstruction, resulting in a collision between the front side of the ego vehicle and the bicyclist. | For more information on this test, see page 31 of the Euro NCAP Test Protocol document. |
"VRU AEB Longitudinal
CBLA" | Vulnerable Road User Automatic Emergency Braking Longitudinal Car-to-Bicyclist Longitudinal Adult | The ego vehicle moves forward toward a bicyclist cycling in front, in the same direction, resulting in a collision between the front side of the ego and the bicyclist. | For more information on this test, see page 32 of the Euro NCAP Test Protocol document. |
"VRU AEB Turning CBTAn" | Vulnerable Road User Automatic Emergency Braking Turning Car-to-Bicyclist Turning Adult nearside | The ego vehicle turns toward a bicyclist crossing its path across a junction, cycling in the opposite direction, from the nearside, resulting in a collision between the front side of the ego and the bicyclist. | For more information on this test, see page 33 of the Euro NCAP Test Protocol document. |
"VRU AEB Turning CBTAf" | Vulnerable Road User Automatic Emergency Braking Turning Car-to-Bicyclist Turning Adult farside | The ego vehicle turns toward a bicyclist crossing its path across a junction, cycling in the opposite direction, from the farside, resulting in a collision between the front side of the ego vehicle and the bicyclist. | For more information on this test, see page 33 of the Euro NCAP Test Protocol document. |
Lane Support System Scenarios
ncapTestName | Euro NCAP Test Scenario Full Name | Description | Euro NCAP Test Protocol Document |
---|---|---|---|
"SA LSS LKA Solid Line" | Safety Assist Lane Support System Lane Keep Assist Solid Line | The ego vehicle drifts beyond a solid lane marking into the adjacent lane. | For more information on this test, see page 17 of the Euro NCAP Test Protocol document. |
"SA LSS LKA Dashed Line" | Safety Assist Lane Support System Lane Keep Assist Dashed Line | The ego vehicle drifts beyond a dashed lane marking into the adjacent lane. | For more information on this test, see page 17 of the Euro NCAP Test Protocol document. |
"SA LSS ELK Solid Line" | Safety Assist Lane Support System Emergency Lane Keeping Solid Line | The ego vehicle drifts beyond a solid lane marking into the adjacent lane. | For more information on this test, see page 15 of the Euro NCAP Test Protocol document. |
"SA LSS ELK Road Edge" | Safety Assist Lane Support System Emergency Lane Keeping Road Edge | The ego vehicle drifts beyond a road edge, moving out of the road. | For more information on this test, see page 15 of the Euro NCAP Test Protocol document. |
"SA LSS ELK Oncoming
vehicle" | Safety Assist Lane Support System Emergency Lane Keeping Oncoming vehicle | The ego vehicle drifts towards an oncoming target into the adjacent lane. | For more information on this test, see page 15 of the Euro NCAP Test Protocol document. |
"SA LSS ELK Overtaking vehicle
intentional" | Safety Assist Lane Support System Emergency Lane Keeping Overtaking vehicle intentional | The ego vehicle intentionally overtakes a target traveling in the same direction on a lane adjacent to the driver side of the ego vehicle. | For more information on this test, see page 16 of the Euro NCAP Test Protocol document. |
"SA LSS ELK Overtaking vehicle
unintentional" | Safety Assist Lane Support System Emergency Lane Keeping Overtaking vehicle unintentional | The ego vehicle unintentionally overtakes a target vehicle traveling in the same direction on a lane adjacent to the driver side of the ego vehicle. | For more information on this test, see page 16 of the Euro NCAP Test Protocol document. |
Version History
Introduced in R2024aR2024b_plus: Additional arguments
The ncapScenario
function now supports these name-value arguments:
ShowProgress
EgoAssetInfo
The ncapScenario
function now returns an additional output argument
scenarioInfo
when you specify AllScenarios=true
as
input
R2024a_plus: Generate seed scenarios for additional Euro NCAP tests
The ncapScenario
function now supports these additional Euro NCAP test scenarios:
"VRU AEB Reverse CPRs"
"VRU AEB Reverse CPRm"
"SA LSS LKA Solid Line"
"SA LSS LKA Dashed Line"
"SA LSS ELK Road Edge"
"SA LSS ELK Solid Line"
"SA LSS ELK Oncoming vehicle"
"SA LSS ELK Overtaking vehicle intentional"
"SA LSS ELK Overtaking vehicle unintentional"
"VRU AEB Lateral CM Oncoming"
"VRU AEB Lateral CM Overtaking unintentional"
"VRU AEB Lateral CM Overtaking intentional"
R2024a_plus: Seed scenario contains fixed ego dimension
For your specified Euro NCAP test scenario
ncapTestName
, the ncapScenario
function specifies the ego vehicle as a sedan with the dimensions
[4.5556
1.9378
1.4538
0.8940
0.9483
2.7133
] in the form [length
width
height
frontOverhang
rearOverhang
wheelbase
]. Units are in meters.
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.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)