SpeedHazardDetection Example#
This example shows a single cyclic Step runnable. Canonical VSS semantics are reused where available, runtime quality is explicitly indicated through enum-based runtime companion interfaces, and FunctionResult is represented as the runtime execution-result contract.
Calibration parameters use VSS-style hierarchical paths under the relevant vehicle-domain branch. Where such paths are not part of the standard catalogue, they shall be treated as approved/illustrative extensions.
1# *******************************************************************************
2# Copyright (c) 2026 ZF Friedrichshafen AG
3#
4# See the NOTICE file(s) distributed with this work for additional
5# information regarding copyright ownership.
6#
7# This program and the accompanying materials are made available under the
8# terms of the Apache License Version 2.0 which is available at
9# https://www.apache.org/licenses/LICENSE-2.0
10#
11# SPDX-License-Identifier: Apache-2.0
12#
13# Contributors:
14# Thomas Pfleiderer - Function specification added
15# Saran Gundlapalli - speed_hazard_detection.afs.yaml updated according to metamodel v0.4.0
16# *******************************************************************************
17
18functionSpecification:
19 name: SpeedHazardDetection
20 version: 1.0.0
21 metaModelRef:
22 name: Eclipse-autoapiframework-Metamodel
23 version: 0.4.0
24
25 description: >-
26 Detects rapid acceleration and requests hazard warning lights if the
27 configured threshold is exceeded.
28
29 dataInterfaces:
30 - name: Vehicle.Speed
31 direction: input
32 dataType: float
33 description: Current vehicle speed value.
34 unit: km/h
35 min: 0.0
36 max: 300.0
37 defaultValue: 0.0
38 resolution: 0.1
39 precision: 1
40 FuSa: true
41 ASIL: B
42 minUpdatePeriodMs: 10
43 accuracy: "+/-0.2 km/h"
44 protection: complement
45 runtimeCompanion:
46 qualityCode:
47 name: Vehicle.Speed.Qualifier
48 datatype: enum
49 enumRef: DataQuality
50
51 # Each Data interface explicitly indicates its runtime quality companion.
52 # The qualifier is an enum-based runtime interface and intentionally does not
53 # duplicate normal Data properties such as min/max/default/resolution.
54
55 - name: Vehicle.Acceleration.Longitudinal
56 direction: input
57 dataType: float
58 description: Longitudinal acceleration used to detect strong acceleration events.
59 unit: m/s2
60 min: -20.0
61 max: 20.0
62 defaultValue: 0.0
63 resolution: 0.01
64 precision: 2
65 FuSa: true
66 ASIL: B
67 minUpdatePeriodMs: 10
68 accuracy: "+/-0.05 m/s2"
69 protection: complement
70 runtimeCompanion:
71 qualityCode:
72 name: Vehicle.Acceleration.Longitudinal.Qualifier
73 datatype: enum
74 enumRef: DataQuality
75
76
77 # Existing VSS semantics shall be reused where available. If the selected
78 # VSS release does not provide an equivalent hazard-light request node,
79 # this path must be treated/documented as an conceptual extension that follows
80 # VSS canonical naming.
81
82 - name: Vehicle.Body.Lights.Hazard.Request
83 direction: output
84 dataType: boolean
85 description: True requests activation of hazard warning lights.
86 unit: boolean
87 min: 0
88 max: 1
89 defaultValue: false
90 resolution: 1
91 precision: 1
92 FuSa: true
93 ASIL: B
94 minUpdatePeriodMs: 20
95 accuracy: logical
96 protection: complement
97
98 - name: Vehicle.Speed.Qualifier
99 direction: input
100 dataType: uint8
101 description: Runtime quality qualifier for Vehicle.Speed value.
102 unit: code
103 min: 0
104 max: 5
105 defaultValue: 0
106 resolution: 1
107 precision: 1
108 FuSa: false
109 ASIL: QM
110 minUpdatePeriodMs: 10
111 accuracy: enum-based
112 protection: none
113
114 parameters:
115 - name: Vehicle.Chassis.SpeedHazardForward
116 dataType: float
117 defaultValue: 10.0
118 description: >-
119 Relative speed increase threshold in percent for triggering
120 hazard request while driving forward.
121 unit: percent
122 tunable: false
123 min: 0.0
124 max: 100.0
125
126 - name: Vehicle.Chassis.HazardRequestDurationMs
127 dataType: uint32
128 defaultValue: 3000
129 description: Hold time for hazard request after trigger.
130 unit: ms
131 tunable: false
132 min: 0
133 max: 600000
134
135 scheduling:
136
137 - functionName: SpeedHazardDetection.Init
138 runType: init
139 description: Initialize internal states and latched outputs.
140 implementedASIL: B
141 executionResult:
142 type: FunctionResult
143 supervision:
144 required: false
145
146 - functionName: SpeedHazardDetection.Step
147 runType: cyclic
148 description: Evaluate inputs and calculate hazard request output.
149 cycleTimeMs: 20
150 implementedASIL: B
151 previousRunnableRef: SpeedHazardDetection.Init
152 executionResult:
153 type: FunctionResult
154 supervision:
155 required: false
156
157 - functionName: SpeedHazardDetection.Terminate
158 runType: terminate
159 description: Shutdown cleanup for deterministic deactivation.
160 implementedASIL: QM
161 previousRunnableRef: SpeedHazardDetection.Step
162 executionResult:
163 type: FunctionResult
164 supervision:
165 required: false