feat: integrate cabin CAN and verified dynamic seat modes

This commit is contained in:
vee
2026-08-04 17:51:38 +08:00
parent 155fbb59ba
commit dc7c91800e
99 changed files with 51897 additions and 3618 deletions
@@ -0,0 +1,51 @@
version: 1.0.0
status: imported_from_can_dev_and_runtime_verified
source:
repository: https://git.kendeji.fun/dev-team/project-code
branch: CAN_DEV
commit: 6e7ed04a468dfcde7efda9e30bc15144bf02faf9
implementation: Cognitive_Agent/native/canfd/can_read_trans.cpp
adapter:
device: ZLG_USBCANFD_200U
device_type: 41
device_index: 0
channel_env: COGNITIVE_AGENT_VEHICLE_CAN_CHANNEL
default_channel: 1
termination_default: false
can_fd:
clock_hz: 60000000
controller_mode: 0
work_mode: normal
standard: iso
arbitration:
bitrate: 500000
tseg1: 14
tseg2: 3
sjw: 2
smp: 0
brp: 5
total_tq: 20
sample_point_pct: 80
data:
bitrate: 2000000
tseg1: 10
tseg2: 2
sjw: 2
smp: 0
brp: 1
total_tq: 15
sample_point_pct: 80
air_outlet:
direction_convention:
horizontal: minimum_left_maximum_right
vertical: minimum_down_maximum_up
ranges:
driver_left: {horizontal: [-25, 40], vertical: [-40, 30]}
driver_right: {horizontal: [-40, 30], vertical: [-40, 30]}
passenger_left: {horizontal: [-10, 40], vertical: [-40, 30]}
passenger_right: {horizontal: [-40, 5], vertical: [-40, 30]}
safety:
raw_frame_passthrough: false
body_channel_must_differ_from_seat_channel: true
send_only_named_capabilities: true
default_feedback_timeout_ms: 1200
@@ -0,0 +1,88 @@
VERSION "CAN_DEV native vehicle controls 6e7ed04"
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
BS_:
BU_: CognitiveAgent VehicleECU
BO_ 478 Media_0x1DE: 8 CognitiveAgent
SG_ Wind_Model_S : 0|4@1+ (1,0) [0|7] "" VehicleECU
SG_ Wind_Volume_Size_S : 4|4@1+ (1,0) [0|7] "" VehicleECU
SG_ Medium_AC_Ctrl_Way_S : 16|2@1+ (1,0) [0|2] "" VehicleECU
SG_ ACB_Close_Button_S : 28|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Ctrl_Set_Main_Driver_Tempt_S : 32|8@1+ (1,0) [18|32] "degC" VehicleECU
SG_ Ctrl_Set_Copilot_Tempratur_S : 40|8@1+ (1,0) [18|32] "degC" VehicleECU
SG_ Ctrl_Set_Rear_Temperature_S : 48|8@1+ (1,0) [18|32] "degC" VehicleECU
BO_ 1028 Right_BCM_0x404: 8 VehicleECU
SG_ ACHMC_AC_On_Status_S : 8|2@1+ (1,0) [0|2] "" CognitiveAgent
SG_ AC_Ctrl_Way_S : 10|2@1+ (1,0) [0|2] "" CognitiveAgent
SG_ AC_Cycle_Mode_404_S : 12|2@1+ (1,0) [0|3] "" CognitiveAgent
SG_ AC_Wind_Model_404_S : 16|4@1+ (1,0) [0|7] "" CognitiveAgent
SG_ Ac_wind_rnk_S : 20|4@1+ (1,0) [0|7] "" CognitiveAgent
SG_ Main_Driver_Set_Temperature_S : 32|8@1+ (1,0) [0|255] "degC" CognitiveAgent
SG_ Copilot_Driver_Set_Temperature_S : 40|8@1+ (1,0) [0|255] "degC" CognitiveAgent
BO_ 811 Media_0x32B: 8 CognitiveAgent
SG_ Sub_ID : 0|8@1+ (1,0) [0|255] "" VehicleECU
SG_ Second_Row_Lock_Request_Instruction_S : 14|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Indoor_Light_Request_Command_S : 24|3@1+ (1,0) [0|2] "" VehicleECU
SG_ Atmosphere_Light_Request_Command_S : 27|5@1+ (1,0) [0|7] "" VehicleECU
SG_ Ambient_Red_S : 8|8@1+ (1,0) [0|255] "" VehicleECU
SG_ Ambient_Green_S : 16|8@1+ (1,0) [0|255] "" VehicleECU
SG_ Ambient_Blue_S : 24|8@1+ (1,0) [0|255] "" VehicleECU
SG_ Ambient_Brightness_S : 32|7@1+ (1,0) [0|100] "%" VehicleECU
BO_ 1073 Media_0x431: 8 CognitiveAgent
SG_ Shade_Voi_Ctrl_Instrct_S : 4|4@1+ (1,0) [0|4] "" VehicleECU
SG_ Left_Front_Window_Ctrl_S : 48|3@1+ (1,0) [0|3] "" VehicleECU
SG_ Right_Front_Window_Ctrl_S : 51|3@1+ (1,0) [0|3] "" VehicleECU
SG_ Left_Rear_Window_Ctrl_S : 56|3@1+ (1,0) [0|3] "" VehicleECU
SG_ Right_Rear_Window_Ctrl_S : 59|3@1+ (1,0) [0|3] "" VehicleECU
BO_ 1217 Media_0x4C1: 8 CognitiveAgent
SG_ Sub_ID : 0|8@1+ (1,0) [0|255] "" VehicleECU
SG_ Driver_Vent_S : 8|4@1+ (1,0) [0|5] "" VehicleECU
SG_ Driver_Heat_S : 12|4@1+ (1,0) [0|5] "" VehicleECU
SG_ Passenger_Vent_S : 16|4@1+ (1,0) [0|5] "" VehicleECU
SG_ Passenger_Heat_S : 20|4@1+ (1,0) [0|5] "" VehicleECU
SG_ Left_Rear_Vent_S : 24|4@1+ (1,0) [0|5] "" VehicleECU
SG_ Left_Rear_Heat_S : 28|4@1+ (1,0) [0|5] "" VehicleECU
SG_ Right_Rear_Vent_S : 32|4@1+ (1,0) [0|5] "" VehicleECU
SG_ Right_Rear_Heat_S : 36|4@1+ (1,0) [0|5] "" VehicleECU
BO_ 1269 Media_0x4F5: 8 CognitiveAgent
SG_ Sunroof_Target_Position_S : 24|8@1+ (1,0) [0|255] "%" VehicleECU
SG_ Shade_Target_Position_S : 32|8@1+ (1,0) [0|255] "%" VehicleECU
SG_ RoofLamp_Switch_Set_Item_4F5_S : 50|2@1+ (1,0) [0|2] "" VehicleECU
BO_ 1263 Media_0x4EF: 8 CognitiveAgent
SG_ Sub_ID : 0|8@1+ (1,0) [0|255] "" VehicleECU
SG_ Outlet_Up_Down_1_S : 8|8@1+ (1,-128) [-128|126] "" VehicleECU
SG_ Outlet_Up_Down_2_S : 16|8@1+ (1,-128) [-128|126] "" VehicleECU
SG_ Outlet_Left_Right_1_S : 24|8@1+ (1,-128) [-128|126] "" VehicleECU
SG_ Outlet_Left_Right_2_S : 32|8@1+ (1,-128) [-128|126] "" VehicleECU
BO_ 434 Media_0x1B2: 8 CognitiveAgent
SG_ Front_Left_Reading_Light_S : 0|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Front_Right_Reading_Light_S : 2|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Middle_Left_Reading_Light_S : 4|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Middle_Right_Reading_Light_S : 6|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Middle_Left_Rotary_Light_S : 8|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Middle_Right_Rotary_Light_S : 10|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Rear_Left_Reading_Light_S : 12|2@1+ (1,0) [0|2] "" VehicleECU
SG_ Rear_Right_Reading_Light_S : 14|2@1+ (1,0) [0|2] "" VehicleECU
BO_ 904 Window_Status_0x388: 8 VehicleECU
BO_ 1031 Door_Status_0x407: 8 VehicleECU
BO_ 1066 Seat_Status_0x42A: 8 VehicleECU
BO_ 1070 Light_Status_0x42E: 8 VehicleECU
BO_ 757 Outlet_Status_0x2F5: 8 VehicleECU
BO_ 891 Outlet_Status_0x37B: 8 VehicleECU
BO_ 1050 Shade_Status_0x41A: 8 VehicleECU
+26
View File
@@ -0,0 +1,26 @@
apiVersion: cognitive-agent/v1alpha1
kind: PlatformManifest
metadata:
id: t2g-cabin-bench-platform
name: T2G seat and vehicle dual-channel CAN bench
version: 1.0.0
description: One ZLG USBCANFD-200U owns seat CAN channel 0 and vehicle CAN FD channel 1.
spec:
platform: t2g_cabin_bench
execution_enabled: true
dbc_files:
- ../t2g_seat_bench/can/dbc/seat.dbc
- can/dbc/vehicle-native.dbc
buses:
- name: seat_can
backend: zlgcan
channel_env: COGNITIVE_AGENT_SEAT_CAN_CHANNEL
fd: false
- name: body_can
backend: zlgcan
channel_env: COGNITIVE_AGENT_VEHICLE_CAN_CHANNEL
fd: true
supported_domains: [seat, climate, door, window, outlet, interior_light, ambient_light, roof]
calibrations:
seat: ../t2g_seat_bench/calibration/seat.yaml
body_can: calibration/body_can.yaml
@@ -13,6 +13,9 @@ protocol:
absolute_position_opcode: 1
timed_duty_opcode: 3
stop_all_opcode: 9
start_dynamic_mode_opcode: 14
stop_dynamic_mode_opcode: 15
dynamic_status_frame_id: 774
stop_all_motor_selector: 0
home_known_range_opcode: 11
home_known_range_key: 19282
@@ -35,6 +38,19 @@ protocol:
timed_duty_max_duration_ms: 30000
increase_direction: 1
decrease_direction: 2
dynamic_modes:
max_runtime_ms: 600000
arrival_grace_ms: 30000
rocking_horse:
mode_id: 1
phases:
- {id: rock_forward, completion: all_targets_reached, timeout_ms: 15000}
- {id: rock_backward, completion: all_targets_reached, timeout_ms: 15000}
cradle:
mode_id: 2
phases:
- {id: forward, completion: all_targets_reached, timeout_ms: 30000}
- {id: return, completion: all_targets_reached, timeout_ms: 30000}
axes:
seat.set_longitudinal_position:
motor_selector: 0
+12
View File
@@ -95,8 +95,20 @@ BO_ 773 T2G_Seat_Thermal_Current_Diagnostic_305: 8 T2G_SEAT
SG_ Fan_Adc_Error_Count : 48|8@1+ (1,0) [0|255] "" HOST
SG_ Heater_Adc_Error_Count : 56|8@1+ (1,0) [0|255] "" HOST
BO_ 774 T2G_Seat_Dynamic_Mode_Status_306: 8 T2G_SEAT
SG_ Dynamic_Mode_ID : 0|8@1+ (1,0) [0|2] "" HOST
SG_ Dynamic_State : 8|8@1+ (1,0) [0|3] "" HOST
SG_ Dynamic_Phase : 16|8@1+ (1,0) [0|6] "" HOST
SG_ Dynamic_Active_Mask : 24|4@1+ (1,0) [0|15] "" HOST
SG_ Dynamic_Fault_Mask : 28|4@1+ (1,0) [0|15] "" HOST
SG_ Dynamic_Cycle_Index : 32|16@1+ (1,0) [0|65535] "cycle" HOST
SG_ Dynamic_Phase_Elapsed_Ms : 48|16@1+ (1,0) [0|65535] "ms" HOST
VAL_ 670 Driver_Seat_Ventilation_On 0 "invalid" 1 "on" 2 "off" 3 "reserved" ;
VAL_ 670 Driver_Seat_Heating_On 0 "invalid" 1 "on" 2 "off" 3 "reserved" ;
VAL_ 769 Ack 0 "none" 1 "accepted" 2 "rejected" 3 "duplicate" 4 "stop_all_accepted" ;
VAL_ 770 Task_State 0 "idle" 1 "accepted" 2 "position_run" 3 "timed_run" 4 "calibration" 5 "stopping" 6 "complete" 7 "fault" ;
VAL_ 770 Result 0 "none" 1 "running" 2 "ok" 3 "stopped_by_cmd" 4 "endpoint_reached" 5 "stall" 6 "timeout" 7 "driver_fault" 8 "hall_fault" 9 "invalid_cmd" 10 "interlocked" 11 "calibration_failed" ;
VAL_ 774 Dynamic_Mode_ID 0 "none" 1 "rocking_horse" 2 "cradle" ;
VAL_ 774 Dynamic_State 0 "idle" 1 "entry" 2 "running" 3 "fault" ;
VAL_ 774 Dynamic_Phase 0 "none" 1 "entry" 2 "horse_forward" 3 "horse_backward" 4 "reserved" 5 "cradle_forward" 6 "cradle_return" ;