# 标定系统分层架构图

```mermaid
flowchart TB
  UI[UI / 上层系统] --> ORCH[workshop_orchestrator_v2\n总控编排器]

  ORCH -->|create_session| PLAN[PlanBuilder\n生成阶段计划]
  ORCH -->|execute_session| PRECHECK[PrecheckRunner\n执行前检查]
  ORCH -->|stage dispatch| GW[各专项 Gateway Client]
  ORCH -->|report| RPT[ReportBuilder\n生成最终报告]

  GW --> EXT[external_localization_service]
  GW --> CHA[chassis_calibration_service]
  GW --> CON[control_calibration_service]
  GW --> SEN[sensor_calibration_service]
  GW --> VPM[vehicle_profile_manager]

  subgraph SERVICE[专项包：ROS 接口层]
    EXT1[action/service/readiness]
    CHA1[action/service/readiness]
    CON1[action/service/readiness]
    SEN1[action/service/readiness]
    VPM1[profile query / update / applicability]
  end

  EXT --> EXT1
  CHA --> CHA1
  CON --> CON1
  SEN --> SEN1
  VPM --> VPM1

  subgraph ALG[专项包：算法执行层]
    EXTALG[外部真值校核算法]
    CHAALG[底盘标定算法]
    CONALG[运控评估算法]
    SENALG[传感器标定算法]
  end

  EXT1 --> EXTALG
  CHA1 --> CHAALG
  CON1 --> CONALG
  SEN1 --> SENALG

  EXTALG -->|结果翻译| EXT1
  CHAALG -->|结果翻译| CHA1
  CONALG -->|结果翻译| CON1
  SENALG -->|结果翻译| SEN1

  classDef core fill:#dbeafe,stroke:#2563eb,color:#1e3a8a;
  classDef service fill:#fef3c7,stroke:#d97706,color:#92400e;
  classDef algo fill:#d1fae5,stroke:#059669,color:#064e3b;

  class ORCH,PLAN,PRECHECK,RPT,GW core;
  class EXT,CHA,CON,SEN,VPM,EXT1,CHA1,CON1,SEN1,VPM1 service;
  class EXTALG,CHAALG,CONALG,SENALG algo;
```

## 说明

- **总控编排器** 只管流程，不直接承载专项算法。
- **专项包** 对外暴露固定 ROS 接口，内部再挂算法执行层。
- **算法层** 可以独立替换，只要输入/输出协议不变。
- **topic / service / action** 用来解耦流程和算法实现。
