Contenuto principale

ncapScore

Obtain score for Euro NCAP test

Since R2025a

Description

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

[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.

example

Examples

collapse all

Specify a Euro NCAP test name from protocol specification years 2026–2028.

ncapTestName = "CA FC CCFtap";

Create a Euro NCAP protocol specification object for protocol specification years 2026–2028.

euroAssessmentObj = euroAssessment(2026);

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

emptyAssessmentTable = assessmentTable(euroAssessmentObj,ncapTestName)
emptyAssessmentTable=16×2 table
     "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 8.3333m/s"    NaN
       "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 12.5m/s"    NaN
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 16.6667m/s"    NaN
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 22.2222m/s"    NaN
     "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 8.3333m/s"    NaN
       "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 12.5m/s"    NaN
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 16.6667m/s"    NaN
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 22.2222m/s"    NaN
     "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 8.3333m/s"    NaN
       "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 12.5m/s"    NaN
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 16.6667m/s"    NaN
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 22.2222m/s"    NaN
     "EgoSpeed = 6.9444m/s, PrimaryTargetSpeed = 8.3333m/s"    NaN
       "EgoSpeed = 6.9444m/s, PrimaryTargetSpeed = 12.5m/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.ImpactVelocity(:) = 1;

Compute the score for the specified Euro NCAP test name.

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

Display the updated assessment table.

disp(assessmentTableUpdated)
                        TestDescription                        ImpactVelocity    EntryStatus    Points    Weights    Colors
    _______________________________________________________    ______________    ___________    ______    _______    ______

    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 8.3333m/s"           1             "Valid"        0          1       "Red" 
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 12.5m/s"             1             "Valid"        0          1       "Red" 
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 16.6667m/s"          1             "Valid"        0          1       "Red" 
    "EgoSpeed = 2.7778m/s, PrimaryTargetSpeed = 22.2222m/s"          1             "Valid"        0          1       "Red" 
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 8.3333m/s"           1             "Valid"        0          1       "Red" 
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 12.5m/s"             1             "Valid"        0          1       "Red" 
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 16.6667m/s"          1             "Valid"        0          1       "Red" 
    "EgoSpeed = 4.1667m/s, PrimaryTargetSpeed = 22.2222m/s"          1             "Valid"        0          1       "Red" 
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 8.3333m/s"           1             "Valid"        0          1       "Red" 
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 12.5m/s"             1             "Valid"        0          1       "Red" 
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 16.6667m/s"          1             "Valid"        0          1       "Red" 
    "EgoSpeed = 5.5556m/s, PrimaryTargetSpeed = 22.2222m/s"          1             "Valid"        0          1       "Red" 
    "EgoSpeed = 6.9444m/s, PrimaryTargetSpeed = 8.3333m/s"           1             "Valid"        0          1       "Red" 
    "EgoSpeed = 6.9444m/s, PrimaryTargetSpeed = 12.5m/s"             1             "Valid"        0          1       "Red" 
    "EgoSpeed = 6.9444m/s, PrimaryTargetSpeed = 16.6667m/s"          1             "Valid"        0          1       "Red" 
    "EgoSpeed = 6.9444m/s, PrimaryTargetSpeed = 22.2222m/s"          1             "Valid"        0          1       "Red" 

Generate a report showing the consolidated assessment results for the Euro NCAP test.

ncapReport(euroAssessmentObj,ncapTestName);

Export the report as a PNG image.

exportReport(euroAssessmentObj,ncapTestName,"results.png")

Specify a group of Euro NCAP test scenario names from protocol specification years 2026–2028.

ncapTestGroup = {'CA FC CCRs','CA FC CCRm','CA FC CCRb','CA FC CCCscp', ...
    'CA FC CCFhol','CA FC CCFhos','CA FC CCFtap','CA FC CPLA', ...
    'CA FC CPFA','CA FC CPNA','CA FC CPNCO', ...
    'CA FC CPTAfo','CA FC CPTAno','CA FC CPTAfs', ...
    'CA FC CPTAns','CA FC CBLA','CA FC CBFA', ...
    'CA FC CBNA','CA FC CBNAO','CA FC CBTAfo', ...
    'CA FC CBTAno','CA FC CBTAfs','CA FC CBTAns', ...
    'CA FC CMRs','CA FC CMRb','CA FC CMCscp','CA FC CMFtap'};

Load assessment criteria values for all the specified scenarios. updatedAssessmentTable is a cell array of the same size as ncapTestGroup. Each cell in updatedAssessmentTable contains a table for its corresponding Euro NCAP test scenario in ncapTestGroup.

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 updatedAssessmentTable.mat

Create a Euro NCAP protocol specification object for protocol specification years 2026–2028.

euroAssessmentObj = euroAssessment(2026);

Create assessment tables for all test scenarios in the test group using the assessmentTable function.

ncapTestGroupAssessmentTables = cellfun(@(x) assessmentTable(euroAssessmentObj,x),ncapTestGroup,UniformOutput=false);

Per Euro NCAP test specifications, the score of each scenario depends on its assessment criteria. For each test scenario:

  1. Get the assessment criteria from its corresponding assessment table.

  2. Update the assessment criteria values using the previously loaded updatedAssessmentTable cell array.

  3. Compute the score for the test scenario using the ncapScore function.

for i = 1:numel(ncapTestGroup)
    ncapScore(euroAssessmentObj,ncapTestGroup{i},updatedAssessmentTable{i});
end

Compute the aggregate Euro NCAP score for the group name representing car-to-car scenarios.

ncapGroupName = "CA FC CarToCar";
[scoreC2C,groupScoreC2C,allScoreC2C] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreC2C = struct with fields:
    AggregateScore: 18.5829
    AvailableScore: 24

groupScoreC2C=7×3 table
    "CCCscp"    6.7500    7.5000
    "CCFhol"    2.2500    2.5000
    "CCFhos"    2.2500    2.5000
    "CCFtap"    4.5000         5
      "CCRb"    0.7915         2
      "CCRm"    1.3664    3.0000
      "CCRs"    0.6750    1.5000

allScoreC2C = struct with fields:
      CCRs: 0.6750
      CCRm: 1.3664
    CCFtap: 4.5000
      CCRb: 0.7915
    CCFhos: 2.2500
    CCFhol: 2.2500
    CCCscp: 6.7500

Compute the aggregate Euro NCAP score for the group name representing car-to-pedestrian scenarios.

ncapGroupName = "CA FC Pedestrian";
[scoreC2P,groupScoreC2P,allScoreC2P] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreC2P = struct with fields:
    AggregateScore: 4.7583
    AvailableScore: 10

groupScoreC2P=5×3 table
     "CPFA"    0.4583    1.2500
     "CPLA"    0.6750    2.5000
     "CPNA"    0.4583    1.2500
    "CPNCO"    0.9167    2.5000
     "CPTA"    2.2500    2.5000

allScoreC2P = struct with fields:
     CPTA: [1×1 struct]
     CPNA: 0.4583
     CPFA: 0.4583
    CPNCO: 0.9167
     CPLA: 0.6750

Compute the aggregate Euro NCAP score for the group name representing car-to-bicyclist scenarios.

ncapGroupName = "CA FC Bicyclist";
[scoreC2B,groupScoreC2B,allScoreC2B] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreC2B = struct with fields:
    AggregateScore: 4.1343
    AvailableScore: 10

groupScoreC2B=5×3 table
     "CBFA"    0.4583    1.2500
     "CBLA"    0.5093    2.5000
     "CBNA"    0.4583    1.2500
    "CBNAO"    0.4583    1.2500
     "CBTA"    2.2500    2.5000

allScoreC2B = struct with fields:
     CBTA: [1×1 struct]
     CBFA: 0.4583
     CBNA: 0.4583
    CBNAO: 0.4583
     CBLA: 0.5093

Compute the aggregate Euro NCAP score for the group name representing car-to-motorcyclist scenarios.

ncapGroupName = "CA FC Motorcyclist";
[scoreC2M,groupScoreC2M,allScoreC2M] = ncapScore(euroAssessmentObj,ncapGroupName)
scoreC2M = struct with fields:
    AggregateScore: 12.7472
    AvailableScore: 16

groupScoreC2M=4×3 table
    "CMCscp"    6.7500    7.5000
    "CMFtap"    4.5000         5
      "CMRb"    0.8222         2
      "CMRs"    0.6750    1.5000

allScoreC2M = struct with fields:
      CMRs: 0.6750
      CMRb: 0.8222
    CMFtap: 4.5000
    CMCscp: 6.7500

Generate a report showing the consolidated assessment results for all the Euro NCAP frontal collision scenarios.

ncapGroupName = "CA FC";
ncapReport(euroAssessmentObj,ncapGroupName);

Export the generated report as a PNG image.

exportReport(euroAssessmentObj,ncapGroupName,"results.png")

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, representing a valid Euro NCAP test scenario name. The list of valid Euro NCAP test scenario names depends on the protocol specification year specified by the Year property of euroAssessmentObj.

For more information on the Euro NCAP test scenarios, see Euro NCAP Car Safety Protocols.

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, representing a valid Euro NCAP test group or subgroup name. The list of valid Euro NCAP test group and subgroup names depends on the protocol specification year specified by the Year property of euroAssessmentObj.

For more information on the Euro NCAP test scenarios, see Euro NCAP Car Safety Protocols.

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.

Limitations

The ncapScore, ncapReport, and exportReport object functions does not support these scenarios:

  • "SA LSS Lane Departure Warning"

  • "SA LSS HMI Blind Spot Monitoring GVT"

  • "SA LSS HMI Blind Spot Monitoring EMT"

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 and Generate Report example. For more information on how to compute assessment criteria values, see the 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.

[2] European New Car Assessment Programme (Euro NCAP). Assessment Protocol - Safety Assist Collision Avoidance, Implementation 2023, Version 10.4.1, February 2024.

Version History

Introduced in R2025a

expand all