This commit is contained in:
orin
2026-07-30 08:45:38 +08:00
commit 25b24ac4cd
1333 changed files with 170092 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
domain: climate
primary_owner: climate_owner
reviewers:
- integration_owner
- can_owner
paths:
- domains/climate/**
+7
View File
@@ -0,0 +1,7 @@
# Climate Domain
空调领域已根据根目录 `空调-天幕-氛围灯CAN信号矩阵表.xlsx` 的“空调”工作表完成 dry-run 闭环。
当前能力包括分区电源、18–32℃ 温度、整车 0–7 档风量、A/C、内外循环、分区吹面/吹脚和前除霜。`can/can-matrix.yaml` 保留来源信号名、帧 ID、Sub ID、Start Bit 和 Bit Length;`can/signal-mapping.yaml` 负责把稳定语义参数确定性转换为矩阵原始值。
命令主要使用 `0x064` 的 `0x03`–`0x06` 子帧,虚拟反馈使用 `0x0DB` 和 `0x404`。源表未提供完整周期、计数器、校验和、总线通道和车型适用性,`hardware_execution_allowed` 固定为 `false`。
+77
View File
@@ -0,0 +1,77 @@
version: 1.0.0
source:
file: 空调-天幕-氛围灯CAN信号矩阵表.xlsx
sheet: 空调
scope: normalized_climate_subset
hardware_execution_allowed: false
limitations:
- Source workbook is a partial matrix without bus timing, counters, checksums, or vehicle variant applicability.
- Sub IDs are encoded as the first payload byte for virtual execution.
messages:
- name: Climate_Control_064_03
frame_id: 100
minimum_payload_bytes: 8
fixed_signals: {Sub_ID: 3}
signals:
- {name: Sub_ID, start_bit: 0, bit_length: 8}
- {name: Atomic_AC_S, start_bit: 36, bit_length: 2}
- {name: Atomic_cycle_mode_S, start_bit: 38, bit_length: 2}
- {name: Atomic_defrosting_S, start_bit: 40, bit_length: 2}
- {name: Atomic_vehicle_air_conditioning_switch_S, start_bit: 50, bit_length: 2}
- {name: Atomic_front_air_conditioning_switch_S, start_bit: 52, bit_length: 2}
- {name: Atomic_rear_air_conditioning_switch_S, start_bit: 54, bit_length: 2}
- {name: Atomic_driver_air_conditioning_switch_S, start_bit: 56, bit_length: 2}
- {name: Atomic_passenger_air_conditioning_switch_S, start_bit: 58, bit_length: 2}
- {name: Atomic_left_rear_air_conditioning_switch_S, start_bit: 60, bit_length: 2}
- {name: Atomic_right_rear_air_conditioning_switch_S, start_bit: 62, bit_length: 2}
- name: Climate_Control_064_04
frame_id: 100
minimum_payload_bytes: 8
fixed_signals: {Sub_ID: 4}
signals:
- {name: Sub_ID, start_bit: 0, bit_length: 8}
- {name: Atomic_vehicle_air_volume_S, start_bit: 8, bit_length: 4}
- {name: Atomic_vehicle_air_conditioning_temperature_S, start_bit: 40, bit_length: 8}
- {name: Atomic_front_air_conditioning_temperature_S, start_bit: 48, bit_length: 8}
- {name: Atomic_rear_air_conditioning_temperature_S, start_bit: 56, bit_length: 8}
- name: Climate_Control_064_05
frame_id: 100
minimum_payload_bytes: 8
fixed_signals: {Sub_ID: 5}
signals:
- {name: Sub_ID, start_bit: 0, bit_length: 8}
- {name: Atomic_driver_air_conditioning_temperature_S, start_bit: 8, bit_length: 8}
- {name: Atomic_passenger_air_conditioning_temperature_S, start_bit: 16, bit_length: 8}
- {name: Atomic_left_rear_air_conditioning_temperature_S, start_bit: 24, bit_length: 8}
- {name: Atomic_right_rear_air_conditioning_temperature_S, start_bit: 32, bit_length: 8}
- {name: Atomic_driver_air_conditioning_outlet_mode_S, start_bit: 56, bit_length: 4}
- {name: Atomic_left_rear_air_conditioning_outlet_mode_S, start_bit: 60, bit_length: 4}
- name: Climate_Control_064_06
frame_id: 100
minimum_payload_bytes: 4
fixed_signals: {Sub_ID: 6}
signals:
- {name: Sub_ID, start_bit: 0, bit_length: 8}
- {name: Atomic_co_pilot_air_conditioning_outlet_mode_S, start_bit: 8, bit_length: 4}
- {name: Atomic_right_rear_air_conditioning_outlet_mode_S, start_bit: 16, bit_length: 4}
- name: Climate_Status_0DB
frame_id: 219
minimum_payload_bytes: 8
signals:
- {name: ACHMC_AC_Open_Rslt_Fdbck_Infor_S, start_bit: 0, bit_length: 2}
- {name: AV_Close_Results_Feedback_S, start_bit: 2, bit_length: 2}
- {name: AC_Cycle_Mode_0DB_S, start_bit: 4, bit_length: 2}
- {name: Medium_AC_Switch_S, start_bit: 6, bit_length: 2}
- {name: ACHMC_Mast_Dri_Temp_Set_Rslt_S, start_bit: 8, bit_length: 5}
- {name: Co_Pilot_AC_Temp_Set_S, start_bit: 16, bit_length: 5}
- {name: AC_Wind_Model_0DB_S, start_bit: 28, bit_length: 4}
- {name: IKEY_AC_Air_Gear_S, start_bit: 32, bit_length: 4}
- {name: ACHMC_AC_Front_Defrosting_Fdbck_S, start_bit: 41, bit_length: 2}
- name: Climate_Status_404
frame_id: 1028
minimum_payload_bytes: 4
signals:
- {name: ACHMC_AC_On_Status_S, start_bit: 8, bit_length: 2}
- {name: AC_Cycle_Mode_404_S, start_bit: 12, bit_length: 2}
- {name: AC_Wind_Model_404_S, start_bit: 16, bit_length: 4}
- {name: Ac_wind_rnk_S, start_bit: 20, bit_length: 4}
+36
View File
@@ -0,0 +1,36 @@
apiVersion: cognitive-agent/v1alpha1
kind: SignalMapping
metadata:
id: climate-reference-vehicle-mapping
name: Climate mapping from supplied CAN matrix
version: 1.0.0
description: Virtual-only mapping normalized from the supplied climate worksheet.
spec:
domain: climate
platform: reference_vehicle
dbc_ref: ../../../platforms/reference_vehicle/can/dbc/vehicle.dbc
matrix_ref: can-matrix.yaml
status: draft
mappings:
- {capability: climate.set_power, parameter: state, target_zone: vehicle, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_vehicle_air_conditioning_switch_S, value_map: {"on": 1, "off": 2}, feedback_message: Climate_Status_404, feedback_signal: ACHMC_AC_On_Status_S, feedback_handler: compile_enum, feedback_value_map: {"on": 1, "off": 2}}
- {capability: climate.set_power, parameter: state, target_zone: front_row, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_front_air_conditioning_switch_S, value_map: {"on": 1, "off": 2}}
- {capability: climate.set_power, parameter: state, target_zone: rear_row, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_rear_air_conditioning_switch_S, value_map: {"on": 1, "off": 2}}
- {capability: climate.set_power, parameter: state, target_zone: driver, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_driver_air_conditioning_switch_S, value_map: {"on": 1, "off": 2}}
- {capability: climate.set_power, parameter: state, target_zone: passenger, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_passenger_air_conditioning_switch_S, value_map: {"on": 1, "off": 2}}
- {capability: climate.set_power, parameter: state, target_zone: rear_left, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_left_rear_air_conditioning_switch_S, value_map: {"on": 1, "off": 2}}
- {capability: climate.set_power, parameter: state, target_zone: rear_right, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_right_rear_air_conditioning_switch_S, value_map: {"on": 1, "off": 2}}
- {capability: climate.set_temperature, parameter: temperature_c, target_zone: vehicle, compiler_handler: compile_integer, bus: cabin_can, message: Climate_Control_064_04, signal: Atomic_vehicle_air_conditioning_temperature_S, unit: celsius}
- {capability: climate.set_temperature, parameter: temperature_c, target_zone: front_row, compiler_handler: compile_integer, bus: cabin_can, message: Climate_Control_064_04, signal: Atomic_front_air_conditioning_temperature_S, unit: celsius}
- {capability: climate.set_temperature, parameter: temperature_c, target_zone: rear_row, compiler_handler: compile_integer, bus: cabin_can, message: Climate_Control_064_04, signal: Atomic_rear_air_conditioning_temperature_S, unit: celsius}
- {capability: climate.set_temperature, parameter: temperature_c, target_zone: driver, compiler_handler: compile_integer, bus: cabin_can, message: Climate_Control_064_05, signal: Atomic_driver_air_conditioning_temperature_S, feedback_message: Climate_Status_0DB, feedback_signal: ACHMC_Mast_Dri_Temp_Set_Rslt_S, feedback_handler: compile_temperature_feedback, unit: celsius}
- {capability: climate.set_temperature, parameter: temperature_c, target_zone: passenger, compiler_handler: compile_integer, bus: cabin_can, message: Climate_Control_064_05, signal: Atomic_passenger_air_conditioning_temperature_S, feedback_message: Climate_Status_0DB, feedback_signal: Co_Pilot_AC_Temp_Set_S, feedback_handler: compile_temperature_feedback, unit: celsius}
- {capability: climate.set_temperature, parameter: temperature_c, target_zone: rear_left, compiler_handler: compile_integer, bus: cabin_can, message: Climate_Control_064_05, signal: Atomic_left_rear_air_conditioning_temperature_S, unit: celsius}
- {capability: climate.set_temperature, parameter: temperature_c, target_zone: rear_right, compiler_handler: compile_integer, bus: cabin_can, message: Climate_Control_064_05, signal: Atomic_right_rear_air_conditioning_temperature_S, unit: celsius}
- {capability: climate.set_fan_level, parameter: level, target_zone: vehicle, compiler_handler: compile_level_plus_one, bus: cabin_can, message: Climate_Control_064_04, signal: Atomic_vehicle_air_volume_S, feedback_message: Climate_Status_404, feedback_signal: Ac_wind_rnk_S, feedback_handler: compile_integer}
- {capability: climate.set_ac, parameter: state, target_zone: vehicle, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_AC_S, value_map: {"on": 1, "off": 2}, feedback_message: Climate_Status_0DB, feedback_signal: Medium_AC_Switch_S, feedback_handler: compile_enum, feedback_value_map: {"on": 2, "off": 1}}
- {capability: climate.set_cycle_mode, parameter: mode, target_zone: vehicle, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_cycle_mode_S, value_map: {internal: 1, external: 2}, feedback_message: Climate_Status_0DB, feedback_signal: AC_Cycle_Mode_0DB_S, feedback_handler: compile_enum, feedback_value_map: {internal: 2, external: 1}}
- {capability: climate.set_front_defrost, parameter: state, target_zone: vehicle, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_03, signal: Atomic_defrosting_S, value_map: {"on": 1, "off": 2}, feedback_message: Climate_Status_0DB, feedback_signal: ACHMC_AC_Front_Defrosting_Fdbck_S, feedback_handler: compile_enum, feedback_value_map: {"on": 2, "off": 1}}
- {capability: climate.set_outlet_mode, parameter: mode, target_zone: driver, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_05, signal: Atomic_driver_air_conditioning_outlet_mode_S, value_map: {face: 1, feet: 2}, feedback_message: Climate_Status_0DB, feedback_signal: AC_Wind_Model_0DB_S, feedback_handler: compile_enum, feedback_value_map: {face: 1, feet: 3}}
- {capability: climate.set_outlet_mode, parameter: mode, target_zone: rear_left, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_05, signal: Atomic_left_rear_air_conditioning_outlet_mode_S, value_map: {face: 1, feet: 2}}
- {capability: climate.set_outlet_mode, parameter: mode, target_zone: passenger, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_06, signal: Atomic_co_pilot_air_conditioning_outlet_mode_S, value_map: {face: 1, feet: 2}, feedback_message: Climate_Status_0DB, feedback_signal: AC_Wind_Model_0DB_S, feedback_handler: compile_enum, feedback_value_map: {face: 1, feet: 3}}
- {capability: climate.set_outlet_mode, parameter: mode, target_zone: rear_right, compiler_handler: compile_enum, bus: cabin_can, message: Climate_Control_064_06, signal: Atomic_right_rear_air_conditioning_outlet_mode_S, value_map: {face: 1, feet: 2}}
+96
View File
@@ -0,0 +1,96 @@
apiVersion: cognitive-agent/v1alpha1
kind: CapabilityCatalog
metadata:
id: climate-capabilities
name: Climate capabilities
version: 1.0.0
spec:
domain: climate
capabilities:
- name: climate.set_power
description: Turn HVAC power on or off for the requested cabin zone.
target_devices: [hvac]
target_scopes: [driver, passenger, front_row, rear_row, rear_left, rear_right, vehicle]
parameters:
- name: state
type: string
required: true
allowed_values: ["on", "off"]
description: Absolute HVAC power state.
risk_level: low
confirmation_policy: on_ambiguity
- name: climate.set_temperature
description: Set an absolute HVAC temperature from 18 to 32 degrees Celsius.
target_devices: [hvac]
target_scopes: [driver, passenger, front_row, rear_row, rear_left, rear_right, vehicle]
parameters:
- name: temperature_c
type: number
unit: celsius
minimum: 18
maximum: 32
required: true
description: Absolute requested temperature in degrees Celsius.
risk_level: medium
confirmation_policy: on_ambiguity
- name: climate.set_fan_level
description: Set whole-cabin airflow to an absolute integer level from 0 to 7.
target_devices: [hvac]
target_scopes: [vehicle]
parameters:
- name: level
type: integer
minimum: 0
maximum: 7
required: true
description: Absolute fan level, where 0 is off and 7 is maximum.
risk_level: low
confirmation_policy: on_ambiguity
- name: climate.set_ac
description: Turn the air-conditioning compressor request on or off.
target_devices: [hvac]
target_scopes: [vehicle]
parameters:
- name: state
type: string
required: true
allowed_values: ["on", "off"]
description: Absolute compressor request state.
risk_level: low
confirmation_policy: on_ambiguity
- name: climate.set_cycle_mode
description: Select internal or external cabin air circulation.
target_devices: [hvac]
target_scopes: [vehicle]
parameters:
- name: mode
type: string
required: true
allowed_values: [internal, external]
description: Absolute circulation mode.
risk_level: low
confirmation_policy: on_ambiguity
- name: climate.set_outlet_mode
description: Direct a zone outlet toward the face or feet.
target_devices: [hvac]
target_scopes: [driver, passenger, rear_left, rear_right]
parameters:
- name: mode
type: string
required: true
allowed_values: [face, feet]
description: Absolute outlet direction.
risk_level: low
confirmation_policy: on_ambiguity
- name: climate.set_front_defrost
description: Turn front windshield defrost on or off.
target_devices: [hvac]
target_scopes: [vehicle]
parameters:
- name: state
type: string
required: true
allowed_values: ["on", "off"]
description: Absolute front defrost state.
risk_level: medium
confirmation_policy: on_ambiguity
+36
View File
@@ -0,0 +1,36 @@
apiVersion: cognitive-agent/v1alpha1
kind: FunctionPreset
metadata:
id: climate-comfort
name: Climate comfort preset
version: 1.0.0
description: Virtual comfort values backed by the supplied partial matrix.
spec:
domain: climate
operations:
- id: set_cabin_temperature
capability: climate.set_temperature
target:
device: hvac
zone: vehicle
parameters:
temperature_c: 23
transition:
profile: device_default
timeout_ms: 5000
failure_policy: continue
- id: set_cabin_fan
capability: climate.set_fan_level
target:
device: hvac
zone: vehicle
parameters:
level: 3
transition:
duration_ms: 1500
profile: ease_in_out
timeout_ms: 5000
failure_policy: continue
locked_parameters: []
applicability:
platform: reference_vehicle
+16
View File
@@ -0,0 +1,16 @@
apiVersion: cognitive-agent/v1alpha1
kind: DomainManifest
metadata:
id: climate-domain-plugin
name: Climate domain plugin
version: 0.1.0
spec:
domain: climate
entrypoint: climate_domain.plugin:create_plugin
function_schema: schemas/function-parameters.schema.json
capabilities: config/capabilities.yaml
signal_mapping: can/signal-mapping.yaml
supported_platforms:
- reference_vehicle
telemetry_required: true
+76
View File
@@ -0,0 +1,76 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cognitive-agent.local/domains/climate/function-parameters.schema.json",
"title": "ClimateFunctionParameters",
"type": "object",
"properties": {
"spec": {
"type": "object",
"properties": {
"domain": {"const": "climate"},
"operations": {
"type": "array",
"items": {
"oneOf": [
{
"properties": {
"capability": {"enum": ["climate.set_power", "climate.set_ac", "climate.set_front_defrost"]},
"parameters": {
"type": "object",
"additionalProperties": false,
"required": ["state"],
"properties": {"state": {"enum": ["on", "off"]}}
}
}
},
{
"properties": {
"capability": {"const": "climate.set_temperature"},
"parameters": {
"type": "object",
"additionalProperties": false,
"required": ["temperature_c"],
"properties": {"temperature_c": {"type": "number", "minimum": 18, "maximum": 32}}
}
}
},
{
"properties": {
"capability": {"const": "climate.set_fan_level"},
"parameters": {
"type": "object",
"additionalProperties": false,
"required": ["level"],
"properties": {"level": {"type": "integer", "minimum": 0, "maximum": 7}}
}
}
},
{
"properties": {
"capability": {"const": "climate.set_cycle_mode"},
"parameters": {
"type": "object",
"additionalProperties": false,
"required": ["mode"],
"properties": {"mode": {"enum": ["internal", "external"]}}
}
}
},
{
"properties": {
"capability": {"const": "climate.set_outlet_mode"},
"parameters": {
"type": "object",
"additionalProperties": false,
"required": ["mode"],
"properties": {"mode": {"enum": ["face", "feet"]}}
}
}
}
]
}
}
}
}
}
}
+4
View File
@@ -0,0 +1,4 @@
# Climate Plugin Source
实现 `plugin.py`、`generator.py`、`validator.py`、`compiler.py` 和 `telemetry.py`。分区、摄氏温度、百分比风量必须在 Compiler 中转换为平台定义的 message/signal,不直接发送 CAN。
+4
View File
@@ -0,0 +1,4 @@
# Climate Tests
覆盖温度/风量边界、不同 zone、自动模式冲突、平台不支持、发送超时和状态回读。`integration/` 使用模拟 CAN Gateway;HIL/实车用例单独标记。
+1
View File
@@ -0,0 +1 @@
+1
View File
@@ -0,0 +1 @@
+1
View File
@@ -0,0 +1 @@