$npx -y skills add matlab/matlab-agentic-toolkit --skill matlab-ncap-testingGenerate Euro NCAP test scenarios and variants using the ADT Euro NCAP support package. Use when creating NCAP seed scenarios, generating variants, translating between drivingScenario and RoadRunner, plotting scenario descriptors, computing NCAP scores, or exporting reports. Tri
| 1 | # Generate Euro NCAP Variants |
| 2 | |
| 3 | Create Euro NCAP seed scenarios, generate variants, translate between simulators, plot descriptors, and compute scores using the ADT Euro NCAP support package APIs. |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | - Creating Euro NCAP seed scenarios (any protocol year) |
| 8 | - Generating scenario variants from seeds |
| 9 | - Translating scenarios between drivingScenario and RoadRunner via descriptors |
| 10 | - Plotting scenario descriptors (single or multi-descriptor grids) |
| 11 | - Computing NCAP scores and generating/exporting reports |
| 12 | - Any workflow mentioning Euro NCAP test names (CCRs, CCFtap, CCCscp, CPNA, etc.) |
| 13 | |
| 14 | ## When NOT to Use |
| 15 | |
| 16 | - Building custom drivingScenario from scratch (roads, lanes, actors) — use drivingScenario core APIs directly |
| 17 | - RoadRunner scene/project management (creating projects, importing assets) — use RoadRunner scene APIs |
| 18 | - Custom `variationProperties` for non-NCAP scenarios |
| 19 | - Simulink co-simulation or AEB test bench setup |
| 20 | |
| 21 | ## Decision Tree: Which API Path? |
| 22 | |
| 23 | ``` |
| 24 | User wants Euro NCAP scenarios? |
| 25 | │ |
| 26 | ├─ Protocol year 2023 (or unspecified)? |
| 27 | │ └─ Use standalone: ncapScenario("SA AEB CCFtap") |
| 28 | │ - Test names use prefix: "SA AEB", "SA LSS", "VRU AEB", "VRU LSS" |
| 29 | │ - Supports ShowProgress name-value |
| 30 | │ - Returns ScenarioDescriptor |
| 31 | │ |
| 32 | └─ Protocol year 2026? |
| 33 | └─ Use euroAssessment path: |
| 34 | 1. ea = euroAssessment(2026) |
| 35 | 2. configureVUT(ea, ...) — if custom VUT needed |
| 36 | 3. descriptor = ncapScenario(ea, "CA FC CCFtap") |
| 37 | - Test names use prefix: "CA FC" |
| 38 | - Does NOT support ShowProgress |
| 39 | - Required for scoring/reporting workflow |
| 40 | ``` |
| 41 | |
| 42 | ## Key Functions |
| 43 | |
| 44 | | Function | Purpose | Available From | |
| 45 | |----------|---------|----------------| |
| 46 | | `ncapScenario` | Generate seed descriptor(s) from test name | R2024a | |
| 47 | | `euroAssessment` | Store 2026 protocol specs and scores | R2025a | |
| 48 | | `configureVUT` | Set StabilizationTime, AssetPath on euroAssessment | R2026a | |
| 49 | | `getScenario` | Convert descriptor → drivingScenario or RoadRunner | R2022b | |
| 50 | | `getScenarioDescriptor` | Extract descriptor from existing drivingScenario | R2022b | |
| 51 | | `generateVariants` | Generate variant descriptors from seed + variationProperties | R2023a | |
| 52 | | `plot` (ScenarioDescriptor) | Plot descriptor(s), returns ScenarioDescriptorPlot | R2026a | |
| 53 | | `configure` (ScenarioDescriptorPlot) | Set GridSize, Title, SubPlotTitles, CropType | R2026a | |
| 54 | | `assessmentTable` | Create empty assessment table for a test | R2025a | |
| 55 | | `ncapScore` | Compute score from assessment table (returns struct) | R2025a | |
| 56 | | `ncapReport` | Generate visual report figure | R2025a | |
| 57 | | `exportReport` | Export report to PDF/PNG/JPG file | R2026a | |
| 58 | | `table2scenario` | Create ScenarioDescriptor from tabular data (sceneSpec, actorSpec, eventSpec) | R2024a | |
| 59 | | `exportScenario` (roadrunner) | Export from RoadRunner to OpenSCENARIO | R2022a | |
| 60 | |
| 61 | ## Pattern: Seed-Only Generation |
| 62 | |
| 63 | Use when you need just the seed scenario (1 descriptor), not all variants. |
| 64 | |
| 65 | ```matlab |
| 66 | % 2023 standalone — single seed |
| 67 | descriptor = ncapScenario("SA AEB CCFtap"); |
| 68 | |
| 69 | % 2026 via euroAssessment — single seed |
| 70 | ea = euroAssessment(2026); |
| 71 | descriptor = ncapScenario(ea, "CA FC CCFtap"); |
| 72 | ``` |
| 73 | |
| 74 | `AllScenarios=true` generates the seed AND all protocol-defined variants. Do NOT use it when only the seed is requested. |
| 75 | |
| 76 | **Output arguments:** The two-output form `[descriptors, scenarioInfo] = ncapScenario(...)` requires `AllScenarios=true`. Without it, only one output is allowed — requesting two outputs errors with "Too many output arguments". |
| 77 | |
| 78 | ## Pattern: All Variants Generation |
| 79 | |
| 80 | Use when the user wants all test variants for a given scenario. |
| 81 | |
| 82 | ```matlab |
| 83 | % 2023 — all variants with progress |
| 84 | [descriptors, scenarioInfo] = ncapScenario("SA AEB CCCscp", AllScenarios=true); |
| 85 | |
| 86 | % 2026 — all variants |
| 87 | ea = euroAssessment(2026); |
| 88 | [descriptors, scenarioInfo] = ncapScenario(ea, "CA FC CCCscp", AllScenarios=true); |
| 89 | ``` |
| 90 | |
| 91 | ## Pattern: ShowProgress |
| 92 | |
| 93 | The `ShowProgress` name-value controls built-in progress display during generation. |
| 94 | |
| 95 | ```matlab |
| 96 | % Show command-line progress (default behavior) |
| 97 | descriptor = ncapScenario("SA AEB CCRs", ShowProgress="CommandLine"); |
| 98 | |
| 99 | % Suppress progress |
| 100 | descriptor = ncapScenario("SA AEB CCRs", ShowProgress="No"); |
| 101 | ``` |
| 102 | |
| 103 | **Important:** `ShowProgress` is only supported on the standalone `ncapScenario(testName)` call. |