Main Content

ncapScore

Obtain score for Euro NCAP test

Since R2025a

Description

[score,assessmentTableUpdated] = ncapScore(euroAssessmentObj,ncapTestName,assessmentTable) obtains the assessment score score for the Euro NCAP® test scenario with name ncapTestName defined by the protocol specifications euroAssessmentObj. The syntax also updates the input Euro NCAP assessment table assessmentTable and stores the assessment table and score in the input protocol specifications object euroAssessmentObj.

example

[score,assessmentTableUpdated] = ncapScore(euroAssessmentObj,ncapTestName) obtains the assessment score score and the assessment table assessmentTableUpdated for the Euro NCAP test scenario with name ncapTestName from the input protocol specifications object euroAssessmentObj. If euroAssessmentObj does not contain a score and updated assessment table for the specified test, the function returns an empty score and empty assessment table.

[score,groupScore,allScore] = ncapScore(euroAssessmentObj,ncapGroupName) obtains all assessment scores from the input protocol specifications object euroAssessmentObj, and returns the aggregated score score for the specified test group name ncapGroupName. The syntax also returns the subgroup score groupScore and the scores for all tests belonging to the specified group ncapGroupName. Note that, for a specified group name, you must use the first syntax of this function to evaluate the scores for its relevant test scenarios prior to using this syntax. Otherwise, this syntax returns the aggregated scores as NaN for test scenarios without evaluated scores.

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.

example

Examples

collapse all

Specify a Euro NCAP test name.

ncapTestName = "SA AEB CCFtap";

Create a Euro NCAP protocol specification object.

euroAssessmentObj = euroAssessment;

Create an empty Euro NCAP assessment table for the specified Euro NCAP test name.

emptyAssessmentTable = assessmentTable(euroAssessmentObj,ncapTestName)
emptyAssessmentTable=9×2 table
                         TestDescription                         CollisionAvoidance
    _________________________________________________________    __________________

    "EgoSpeed = 2.7778m/s, Primary Target Speed = 8.3333m/s"            NaN        
    "EgoSpeed = 2.7778m/s, Primary Target Speed = 12.5m/s"              NaN        
    "EgoSpeed = 2.7778m/s, Primary Target Speed = 16.6667m/s"           NaN        
    "EgoSpeed = 4.1667m/s, Primary Target Speed = 8.3333m/s"            NaN        
    "EgoSpeed = 4.1667m/s, Primary Target Speed = 12.5m/s"              NaN        
    "EgoSpeed = 4.1667m/s, Primary Target Speed = 16.6667m/s"           NaN        
    "EgoSpeed = 5.5556m/s, Primary Target Speed = 8.3333m/s"            NaN        
    "EgoSpeed = 5.5556m/s, Primary Target Speed = 12.5m/s"              NaN        
    "EgoSpeed = 5.5556m/s, Primary Target Speed = 16.6667m/s"           NaN        

Create a copy of the empty assessment table, and fill in the values of the assessment criteria in the table.

filledAssessmentTable = emptyAssessmentTable;
filledAssessmentTable.CollisionAvoidance(:) = 1;

Compute the score for the specified Euro NCAP test name.

[score,assessmentTableUpdated] = ncapScore(euroAssessmentObj,ncapTestName,filledAssessmentTable);

Display the score for the specified Euro NCAP test name.

disp(score)
    AggregateScore: 1
    AvailableScore: 1

Display the updated assessment table.

disp(assessmentTableUpdated)
                         TestDescription                         CollisionAvoidance    EntryStatus    Points    Weights    Colors 
    _________________________________________________________    __________________    ___________    ______    _______    _______

    "EgoSpeed = 2.7778m/s, Primary Target Speed = 8.3333m/s"             1               "Valid"        1          1       "Green"
    "EgoSpeed = 2.7778m/s, Primary Target Speed = 12.5m/s"               1               "Valid"        1          1       "Green"
    "EgoSpeed = 2.7778m/s, Primary Target Speed = 16.6667m/s"            1               "Valid"        1          1       "Green"
    "EgoSpeed = 4.1667m/s, Primary Target Speed = 8.3333m/s"             1               "Valid"        1          1       "Green"
    "EgoSpeed = 4.1667m/s, Primary Target Speed = 12.5m/s"               1               "Valid"        1          1       "Green"
    "EgoSpeed = 4.1667m/s, Primary Target Speed = 16.6667m/s"            1               "Valid"        1          1       "Green"
    "EgoSpeed = 5.5556m/s, Primary Target Speed = 8.3333m/s"             1               "Valid"        1          1       "Green"
    "EgoSpeed = 5.5556m/s, Primary Target Speed = 12.5m/s"               1               "Valid"        1          1       "Green"
    "EgoSpeed = 5.5556m/s, Primary Target Speed = 16.6667m/s"            1               "Valid"        1          1       "Green"

Specify a group of Euro NCAP test scenario names.

ncapTestName = {'SA AEB CCRs','SA AEB CCRm','SA AEB CCRb','SA AEB CCFtap', ...
    'SA AEB CCCscp','SA AEB CCFhos','SA AEB CCFhol','VRU AEB Crossing CPFA', ...
    'VRU AEB Crossing CPNA','VRU AEB Crossing CPNCO','VRU AEB Longitudinal CPLA', ...
    'VRU AEB Turning CPTAns','VRU AEB Turning CPTAno','VRU AEB Turning CPTAfs', ...
    'VRU AEB Turning CPTAfo','VRU AEB Reverse CPRs','VRU AEB Reverse CPRm', ...
    'VRU AEB Longitudinal CMRs','VRU AEB Longitudinal CMRb','VRU AEB Turning CMFtap', ...
    'VRU AEB Crossing CBFA','VRU AEB Crossing CBNA','VRU AEB Crossing CBNAO', ...
    'VRU AEB Longitudinal CBLA','VRU AEB Turning CBTAn','VRU AEB Turning CBTAf', ...
    'SA LSS LKA Solid Line','SA LSS LKA Dashed Line','SA LSS ELK Solid Line', ...
    'SA LSS ELK Road Edge','SA LSS ELK Oncoming vehicle', ...
    'SA LSS ELK Overtaking vehicle intentional', ...
    'SA LSS ELK Overtaking vehicle unintentional', ...
    'VRU LSS CM Oncoming vehicle','VRU LSS CM Overtaking vehicle unintentional', ...
    'VRU LSS CM Overtaking vehicle intentional'};

Load assessment criteria values for all the specified scenarios. assessmentCriteriaEntries is a cell array of the same size as ncapTestName. Each cell in assessmentCriteriaEntries contains the obtained assessment criteria values for its respective Euro NCAP test scenario in ncapTestName.

Note: To use your own assessment data, you can run a test bench for each Euro NCAP test scenario to obtain its assessment criteria values.

load assessmentCriteriaEntries

Create a Euro NCAP protocol specification object.

euroAssessmentObj = euroAssessment;

As per Euro NCAP test specifications, the score of each scenario depends on its assessment criteria. Specify the indices of ncapTestName that share common assessment criteria.

ImpactVelocityAssessmentCriteriaIndices = [1 3 5:10 12:19 21:23 25 26 31:33];   % Common assessment criterion is Impact Velocity
RelativeImpactVelocityAssessmentCriteriaIndices = 2;                            % Common assessment criterion is relative Impact Velocity
CollisionAvoidanceAssessmentCriteriaIndices = [4 20];                           % Common assessment criterion is Collision Avoidance
TTCRelativeImpactVelocityAssessmentCriteriaIndices = [11 24];                   % Common assessment criterion is Time To Collision and Impact Velocity
DTLEAssessmentCriteriaIndices = [27:30];                                        % Common assessment criterion is Distance To Lane Edge
LateralSeperationAssessmentCriteriaIndices = [34:36];                           % Common assessment criterion is Lateral Separation

Create an empty Euro NCAP assessment table for each specified Euro NCAP test name, and assign its respective assessment criteria values to the table.

for i = 1:numel(ncapTestName)
    tableAssessment = assessmentTable(euroAssessmentObj,ncapTestName{i});
    if(ismember(i,ImpactVelocityAssessmentCriteriaIndices))
        tableAssessment.ImpactVelocity = assessmentCriteriaEntries{i}.ImpactVelocity;
        ncapScore(euroAssessmentObj,ncapTestName{i},tableAssessment);
    elseif(ismember(i,RelativeImpactVelocityAssessmentCriteriaIndices))
        tableAssessment.RelativeImpactVelocity = assessmentCriteriaEntries{i}.RelativeImpactVelocity;
        ncapScore(euroAssessmentObj,ncapTestName{i},tableAssessment);
    elseif(ismember(i,CollisionAvoidanceAssessmentCriteriaIndices))
        tableAssessment.CollisionAvoidance = assessmentCriteriaEntries{i}.CollisionAvoidance;
        ncapScore(euroAssessmentObj,ncapTestName{i},tableAssessment);
    elseif(ismember(i,TTCRelativeImpactVelocityAssessmentCriteriaIndices))
        tableAssessment.TTC = assessmentCriteriaEntries{i}.TTC;
        tableAssessment.RelativeImpactVelocity = assessmentCriteriaEntries{i}.RelativeImpactVelocity;
        ncapScore(euroAssessmentObj,ncapTestName{i},tableAssessment);
    elseif(ismember(i,DTLEAssessmentCriteriaIndices))
        tableAssessment.DTLE = assessmentCriteriaEntries{i}.DTLE;
        ncapScore(euroAssessmentObj,ncapTestName{i},tableAssessment);
    elseif(ismember(i,LateralSeperationAssessmentCriteriaIndices))
        tableAssessment.LateralSeperation = assessmentCriteriaEntries{i}.LateralSeperation;
        ncapScore(euroAssessmentObj,ncapTestName{i},tableAssessment);
    end
end

Compute the aggregate Euro NCAP score for the vulnerable road user (VRU) group name.

ncapGroupName = "VRU";
[scoreVRU,groupScoreVRU,allScoreVRU] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreVRU = struct with fields:
    AggregateScore: 10.8021
    AvailableScore: 27

groupScoreVRU=2×3 table
    SubGroup    AggregateScore    AvailableScore
    ________    ______________    ______________

     "AEB"          8.5354              23      
     "LSS"          2.2667               4      

allScoreVRU = struct with fields:
    AEB: [1×1 struct]
    LSS: [1×1 struct]

Compute the aggregate Euro NCAP score for the safety assist (SA) group name.

ncapGroupName = "SA";
[scoreSA,groupScoreSA,allScoreSA] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreSA = struct with fields:
    AggregateScore: 4.5984
    AvailableScore: 11

groupScoreSA=2×3 table
    SubGroup    AggregateScore    AvailableScore
    ________    ______________    ______________

     "AEB"          3.6567             8.5      
     "LSS"         0.94167             2.5      

allScoreSA = struct with fields:
    AEB: [1×1 struct]
    LSS: [1×1 struct]

Input Arguments

collapse all

Euro NCAP assessment protocol specifications, specified as a euroAssessment object.

Euro NCAP test scenario name, specified as a character vector or string scalar. This value must match one of the ncapTestName values listed in the Euro NCAP Test Scenario Information tables.

Euro NCAP assessment table, specified as a table.

To obtain a Euro NCAP assessment table for a test scenario, use the assessmentTable object function. The table must have N rows. N is the number of test scenario variants for the specified Euro NCAP test ncapTestName. The first column of the table, TestDescription, specifies the description of the test scenario through its parameters such as the speeds of the actors. The rest of the columns have values of NaN, which you must replace before specifying the table as input to this function. For more information on how to replace the NaN values, see Tips. For more information on the assessment criteria that Euro NCAP uses to evaluate scores, see the Euro NCAP assessment protocol for vulnerable road user protection [1] and safety assist collision avoidance [2].

Euro NCAP test group name, specified as a character vector or string scalar.

You can specify one of these test group names.

  • "EuroNCAP"

  • "StandardCarUrban"

  • "VRU"

  • "VRU LSS"

  • "VRU AEB"

  • "SA"

  • "SA LSS"

You can also specify one of these test end group names. Each end group represents multiple Euro NCAP test scenarios. For more information on end groups, see Euro NCAP End Group Names.

  • "VRU LSS Car-Motorcyclist"

  • "VRU AEB Car-Motorcyclist"

  • "VRU AEB Car-Bicyclist"

  • "VRU AEB Turning CBTA"

  • "VRU AEB Car-Pedestrian"

  • "VRU AEB Turning CPTA"

  • "SA AEB"

  • "SA LSS LKA"

  • "SA LSS ELK"

This figure shows the grouping hierarchy of Euro NCAP test scenarios in the Automated Driving Toolbox Test Suite for Euro NCAP Protocols support package.

Output Arguments

collapse all

Euro NCAP score, returned as a structure. Depending on the test name ncapTestName you specify at input, the structure returns one or more of these fields:

  • AEB — Autonomous emergency braking scores, returned as a structure containing the AggregateScore and AvailableScore fields.

  • FCW — Forward collision warning scores, returned as a structure containing the AggregateScore and AvailableScore fields.

  • Day — Day scenario scores, returned as a structure containing the AggregateScore and AvailableScore fields.

  • Night — Night scenario scores, returned as a structure containing the AggregateScore and AvailableScore fields.

  • AggregateScore — Obtained aggregated score of the Euro NCAP test scenarios, returned as a scalar.

  • AvailableScore — Maximum obtainable score of the Euro NCAP test scenarios, returned as a scalar.

Updated Euro NCAP assessment table, returned as a table.

The returned table has N rows. N is the number of test scenario variants for the specified Euro NCAP test ncapTestName. Depending on the test name ncapTestName you specify, the function appends one or more of these columns to the input table assessmentTable.

  • EntryStatus — Assessment parameter entry status, returned as a logical 1 (true) or 0 (false). This value indicates whether the assessment criteria parameter value for the specified test has been set. The function returns 1 If the assessment criteria parameter value has been specified. Otherwise, it returns 0.

  • AEBPoints — Autonomous Emergency Braking points, returned as a scalar. This value indicates the AEB points associated with a test scenario.

  • AEBWeights — Autonomous Emergency Braking weights, returned as a scalar. This value indicates the AEB weights associated with a test scenario.

  • AEBColors — Autonomous Emergency Braking colors, returned as a string scalar. This value indicates the colors assigned to a test scenario for report generation.

  • FCWPoints — Forward collision warning points, returned as a scalar. This value indicates the FCW points associated with a test scenario.

  • FCWWeights — Forward collision warning weights, returned as a scalar. This value indicates the FCW points associated with a test scenario.

  • FCWColors — Forward collision warning colors, returned as a string scalar. This value indicates the colors assigned to a test scenario for report generation.

  • Points — Points associated with a test scenario, returned as a scalar.

  • Weights — Weights associated with a test scenario, returned as a scalar.

  • Colors — Colors assigned to a test scenario for report generation, returned as a scalar.

Euro NCAP group score, returned as a structure. The structure contains these fields:

  • SubGroup — Name of the subgroup, returned as a string scalar.

  • AggregateScore — Obtained aggregated subgroup score.

  • AvailableScore — Maximum obtainable subgroup score.

Scores of all Euro NCAP tests, returned as a structure.

The structure contains AggregateScore and AvailableScore fields that represent the obtained aggregated test score and the maximum obtainable score for the specified group, respectively. The structure also contains multiple structures in the Euro NCAP test scenario grouping hierarchy, represented in the figure in the ncapGroupName description. Each level of hierarchy in the structure represents a group, subgroup or end group, and also contains AggregateScore and AvailableScore fields specifying the obtained aggregated test score and the maximum obtainable score at that level.

More About

collapse all

Tips

You must replace the NaN fields of the returned table with appropriate values, and specify the updated table as the assessmentTable input argument of the ncapScore function, to get Euro NCAP assessment scores. For more information, see the Compute Score for Euro NCAP Test Scenario example. For more information on how to compute assessment criteria values, see the AEB Euro NCAP Testing with RoadRunner Scenario example.

References

[1] European New Car Assessment Programme (Euro NCAP). Assessment Protocol - Vulnerable Road User Protection, Implementation 2023, Version 11.4, December 2023. https://www.euroncap.com/media/79885/euro-ncap-assessment-protocol-vru-v114.pdf.

[2] European New Car Assessment Programme (Euro NCAP). Assessment Protocol - Safety Assist Collision Avoidance, Implementation 2023, Version 10.4.1, February 2024. https://www.euroncap.com/media/80154/euro-ncap-assessment-protocol-sa-collision-avoidance-v1041.pdf.

Version History

Introduced in R2025a