-
Notifications
You must be signed in to change notification settings - Fork 13
/
comfort-service.yml
376 lines (344 loc) · 13.1 KB
/
comfort-service.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
#
# Copyright 2022, Robert Bosch GmbH
# Copyright 2020, Jaguar Land Rover
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# Namespace
#
# A namespace is a collection of datatypes, methods, properties,
# events, and other namespaces.
#
#
# TODO:
# + Define error semantics for methods to align with FrancaIDL
#
# + Add array arguments.
#
# + How do we import namespaces, datatypes, etc from other service files?
# Importing datatypes used by multiple services make sense, but it
# will put a strain on the build pipeline since we now will have to
# search for and assemble a library of interdependent services.
#
#
---
name: comfort
major_version: 3
minor_version: 0
description: A collection of interfaces pertaining to cabin comfort, intended to be aligned with corresponding VSS signals.
# Include another VSC file into the current "comfort" namespace
#
includes:
- description: Include all error codes used by this namespace
file: vsc-error.yml
# Create a separate namespace for movement-related datatypes and methods.
# We can create additional namespaces for HVAC, ambient lighting, etc.
#
namespaces:
- name: seats
description: Seat interface and datatypes.
# Defines all structs hosted by the `seats` namespace.
# Standard structs can be defind, using either native types, typedefs,
# or other (nested) structs.
#
structs:
#
# Position of seat
#
- name: position_t
description: |
The position of the entire seat
members:
- name: position
datatype: uint16
description: |
Seat position on vehicle x-axis. Position is in millimeters relative to the frontmost position supported by the seat.
0 = Frontmost position supported.
- name: height
datatype: uint16
description: |
Seat position on vehicle z-axis. Position is in millimeters relative within available movable range of the seating.
0 = Lowermost position supported.
- name: tilt
datatype: float
description: |
Tilting of seat in degrees relative to vehicle z-axis. 0 = seating is flat, seat and vehicle z-axis are parallel.
Positive degrees = seat tilted backwards, seat z-axis is tilted backward.
- name: backrest_recline
datatype: float
description: |
Backrest recline in degrees compared to seat z-axis (seat vertical axis).
0 degrees = Upright/Vertical backrest.
Negative degrees for forward recline. Positive degrees for backward recline.
- name: backrest_lumbar_support
datatype: percent_float_t
description: |
Lumbar support (in/out position) in percent. 0 = Innermost position. 100 = Outermost position.
- name: backrest_lumbar_height
datatype: uint8
description: |
Height of lumbar support in millimeters. Position is relative within available movable range of the lumbar support.
0 = Lowermost position supported.
- name: backrest_sidebolster_support
datatype: percent_float_t
description: |
Side bolster support in percent. 0 = Minimum support (widest side bolster setting).
100 = Maximum support.
- name: seating_length
datatype: uint16
description: |
Length adjustment of seating in millimeters. 0 = Adjustable part of seating in rearmost position
(Shortest length of seating).
- name: headrest_height
datatype: uint8
description: |
Position of headrest in millimeters relative to movable range of the head rest. 0 = Bottommost position supported.
- name: headrest_angle
datatype: float
description: |
Headrest angle in degrees, relative to backrest, 0 degrees if parallel to backrest, Positive degrees = tilted forward.
#
# Seat location
#
- name: seat_location_t
description: |
The location of the seat in the vehicle
members:
- name: row
datatype: uint8
description: |
The row, front 1 and +1 toward rear
- name: index
datatype: uint8
description: |
The index within the row, 1 left most (as seen looking forward), +1 toward right
- name: seat_t
description: |
The structure used to describe the seat's position in the vehicle
members:
- name: location
datatype: seat_location_t
description: |
The location of the seat in the vehicle
- name: position
datatype: position_t
description: |
The various aspects of the seat
# Typedefs
#
# Standard redefinition of native types are supported.
# Min/max intervals can be optionally specified
#
typedefs:
- name: movement_t
datatype: float
description: |
The movement of a seat component. Limits and resolution varies depending on aspect changed,
and typically is vehicle dependent.
# We can also redefine an existing type,
# effectively giving it a new name.
- name: relative_movement_t
datatype: movement_t
description: |
The relative movement of a seat component
- name: percent_float_t
datatype: float
min: 0
max: 100
description: |
Percent represented as float with range restricted from 0 to 100.
enumerations:
# Enums
#
# TODO:
# + Decide if we need to move enum_type (uint8) to a separate deployment
# file, one per target (python, C++, etc).
# The upside is a cleaner, more service-oriented catalog.
# The downside is it inter-target operability is harder to
# define an over-the-wire payload format since one target
# can define uint16_t while another has uint8_t.
#
- name: seat_component_t
datatype: uint8 # Should probably be moved to deployment file
options:
- name: position
value: 0
- name: height
value: 1
- name: tilt
value: 2
- name: backrest_recline
value: 3
- name: backrest_lumbar_support
value: 4
- name: backrest_lumbar_height
value: 5
- name: backrest_sidebolster_support
value: 6
- name: seating_length
value: 7
- name: headrest_height
value: 8
- name: headrest_angle
value: 9
description: |
Current seat component
interface:
name : MyInterface
# METHODS
#
# This section defines all methods for the given namespace.
#
# A method invokes a command for a given service that may optionally
# return a value.
#
# Only one service instance will execute a call. The service discovery
# and invocation mechanism is up to the implementation to resolve (possibly
# with the help of deployment files).
#
methods:
- name: move
description: |
Set the desired seat position
input:
- name: seat
description: |
The desired seat position
datatype: seat_t
errors:
- description: |
"ok" - requested seat movement has been executed successfully
"invalid_argument" - any argument out of range supported by vehicle
"not_found" - addressed seat not available/existing
"interrupted" - operation interrupted
"busy" - seat service is currently busy
"other" - internal error in implementation
datatype: err_enum
range: $ in_set("ok", "invalid_argument", "not_found", "interrupted", "busy", "other")
- name: move_component
description: |
Set a seat component position
# Arguments
#
# Argument can be of any native type, enum, struct, or typedef.
#
input:
- name: seat
description: |
The seat location to change
datatype: seat_location_t
- name: component
description: |
The component position to change
datatype: seat_component_t
- name: position
description: |
The desired position to move the component to
datatype: movement_t
errors:
- description: |
"ok" - requested seat movement has been executed successfully
"invalid_argument" - any argument out of range supported by vehicle
"not_found" - addressed seat not available/existing
"interrupted" - operation interrupted
"busy" - seat service is currently busy
"other" - internal error in implementation
datatype: err_enum
range: $ in_set("ok", "invalid_argument", "not_found", "interrupted", "busy", "other")
- name: current_position
description: |
Get the current position of the seat
input:
- name: row
description: |
The desired seat row to query, front 1 and +1 toward rear
datatype: uint8
- name: index
description: |
The desired seat index to query, 1 left most (as seen looking forward), +1 toward right
datatype: uint8
output:
- name: seat
description: |
The seat state that was requested
datatype: seat_t
errors:
- description: |
"ok" - current position of selected seat has been returned
"invalid_argument" - any argument out of range supported by vehicle
"not_found" - addressed seat not available/existing
"other" - internal error in implementation
It is assumed that this operation does not need unique resources and returns immediately,
so no need to support "interrupted" and "busy" as errors.
datatype: err_enum
range: $ in_set("ok", "invalid_argument", "not_found", "other")
# EVENTS
#
# This section defines all events for the given namespace.
#
# Events are non-returning commands with multiple subscribers,
# much like SOME/IP events.
# Unlike signals an event retains no state (value) after it has
# been called; once it has been sent it is forgotten.
#
# TODO:
# + FrancaIDL may lack semantics to cover this. We need to
# create appropriate transformation rules.
#
events:
- name: seat_moving
description: |
The event of a seat beginning movement
input:
- name: status
description: |
The movement status, moving (1), not moving (0)
datatype: uint8
- name: row
description: |
The row of the seat, front 1 and +1 toward rear
datatype: uint8
- name: index
description: |
The index of the seat position in the row, 1 left most (as seen looking forward), +1 toward right
datatype: uint8
- name: component
description: |
The seat component that is moving
datatype: seat_component_t
- name: passenger_present
description: |
When the seat passenger status changes
input:
- name: status
description: |
The status of seat passenger, passenger (1), no passenger (0)
datatype: boolean
- name: row
description: |
The row of the seat, front 1 and +1 toward rear
datatype: uint8
- name: index
description: |
The index of the seat position in the row, 1 left most (as seen looking forward), +1 toward right
datatype: uint8
# PROPERTIES
#
# This section defines properties for the given namespace.
#
# Properties are service data elements that are distributed
# across one or more subscribers. They are equivalent to
# MQTT topics or SOME/IP fields.
#
# In VSC all properties are considered to be read/write
#
# TODO: Define relationship, rules, and semantics
# between properties and VSS signals.
# See vss_integration_proposal.yml for one solution.
#
properties:
- name: a_property
description: A signal
datatype: uint8