forked from OSVR/OSVR-JSON-Schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice_descriptor_schema.json
279 lines (279 loc) · 9.8 KB
/
device_descriptor_schema.json
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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "OSVR Device Descriptor",
"description": "This schema documents and guides creation of a device descriptor, that both describes the interfaces available, and provides semantic mappings to those interfaces.",
"definitions": {
"semanticAliasLeaf": {
"title": "Alias target (leaf)",
"type": "string",
"pattern": "^[a-zA-Z]/[1-9][0-9]*$"
},
"generalSemanticAliasTarget": {
"oneOf": [
{
"$ref": "#/definitions/semanticAliasLeaf"
},
{
"$ref": "#/definitions/semanticAliasTransform"
}
]
},
"semanticAliasTransform": {
"title": "Alias transform level",
"type": "object",
"properties": {
"child": {
"allOf": [
{
"title": "Nested transform child"
},
{
"$ref": "#/definitions/generalSemanticAliasTarget"
}
]
}
}
},
"semanticAliasGrouping": {
"type": "object",
"title": "Grouping for semantic aliases",
"description": "A 'directory' on the semantic tree. May also contain an alias at its own level, described by '$target'",
"properties": {
"$target": {
"allOf": [
{
"title": "Target for the 'directory-level' path"
},
{
"$ref": "#/definitions/generalSemanticAliasTarget"
}
]
}
},
"additionalProperties": {
"$ref": "#/definitions/semanticAliasNode"
}
},
"semanticAliasNode": {
"oneOf": [
{
"$ref": "#/definitions/generalSemanticAliasTarget"
},
{
"$ref": "#/definitions/semanticAliasGrouping"
}
]
}
},
"type": "object",
"properties": {
"deviceVendor": {
"title": "Device vendor/manufacturer",
"type": "string"
},
"deviceName": {
"title": "Device product name",
"type": "string"
},
"author": {
"title": "Descriptor author name and email address",
"type": "string"
},
"version": {
"title": "Static descriptor version number",
"description": "Increment with each committed change",
"type": "integer",
"default": 1
},
"lastModified": {
"title": "Static descriptor Last-Modified timestamp",
"description": "Should use RFC 3339, section 5.6 format, aka javascript (new Date()).toJSON()",
"type": "string",
"format": "date-time"
},
"interfaces": {
"title": "Interface descriptions",
"type": "object",
"properties": {
"tracker": {
"type": "object",
"title": "Tracker interface description",
"description": "Describes properties of the tracker interface provided by this device.",
"defaultProperties": [
"bounded",
"position",
"orientation",
"linearVelocity",
"angularVelocity",
"linearAcceleration",
"angularAcceleration"
],
"properties": {
"count": {
"title": "Number of sensors",
"description": "number of tracker sensors, if bounded and known",
"type": "integer",
"minimum": 1
},
"bounded": {
"title": "Sensor count bounded?",
"description": "true if the IDs of sensors reporting are bounded (usually known ahead of time) or false if they are unbounded (new ID for each item tracked, for instance)",
"type": "boolean",
"default": true
},
"position": {
"title": "Reports position information?",
"type": "boolean",
"default": true,
"format": "checkbox"
},
"orientation": {
"title": "Reports orientation information?",
"type": "boolean",
"default": true,
"format": "checkbox"
},
"linearVelocity": {
"title": "Reports linear velocity?",
"type": "boolean",
"default": false,
"format": "checkbox"
},
"angularVelocity": {
"title": "Reports angular velocity?",
"type": "boolean",
"default": false,
"format": "checkbox"
},
"linearAcceleration": {
"title": "Reports linear acceleration?",
"type": "boolean",
"default": false,
"format": "checkbox"
},
"angularAcceleration": {
"title": "Reports angular acceleration?",
"type": "boolean",
"default": false,
"format": "checkbox"
},
"traits": {
"title": "Per-sensor traits",
"description": "Array matching the order of sensors. Any values explicitly specified for a sensor here override the 'global' traits specified for the overall tracker interface. Entries in this array are mapped directly to sensors - entry 0 describes sensor 0, etc. Thus, if you want to describe sensor n, you must describe sensor n-1 (at least trivially with an empty object) down to 0.",
"type": "array",
"format": "table",
"items": {
"type": "object",
"defaultProperties": [],
"properties": {
"position": {
"title": "Reports position information?",
"type": "boolean",
"default": true,
"format": "checkbox"
},
"orientation": {
"title": "Reports orientation information?",
"type": "boolean",
"default": true,
"format": "checkbox"
},
"linearVelocity": {
"title": "Reports linear velocity?",
"type": "boolean",
"default": false,
"format": "checkbox"
},
"angularVelocity": {
"title": "Reports angular velocity?",
"type": "boolean",
"default": false,
"format": "checkbox"
},
"linearAcceleration": {
"title": "Reports linear acceleration?",
"type": "boolean",
"default": false,
"format": "checkbox"
},
"angularAcceleration": {
"title": "Reports angular acceleration?",
"type": "boolean",
"default": false,
"format": "checkbox"
}
}
}
}
}
},
"analog": {
"type": "object",
"title": "Analog interface description",
"description": "Describes properties of the analog interface provided by this device.",
"properties": {
"count": {
"title": "Number of sensors/channels",
"description": "number of analog sensors reported",
"type": "integer",
"minimum": 1
},
"traits": {
"title": "Per-sensor traits",
"description": "Entries in this array are mapped directly to analog sensors/channels - entry 0 describes sensor 0, etc. Thus, if you want to describe sensor n, you must describe sensor n-1 (at least trivially with an empty object) down to 0.",
"type": "array",
"format": "table",
"items": {
"type": "object",
"title": "Analog Sensor Traits",
"headerTemplate": "Analog Sensor {{ i0 }}",
"description": "Describes relevant properties of the analog data reported on this sensor/channel. In the case of a joystick, the 'rest' will likely be halfway between 'min' and 'max', while an analog button will likely have 'min' equal to 'rest'. These parameters may be used for scaling the data as requested by a client application or analysis module.",
"properties": {
"min": {
"title": "Minimum value",
"type": "number"
},
"max": {
"title": "Maximum value",
"type": "number"
},
"rest": {
"title": "Value at rest",
"type": "number"
}
},
"defaultProperties": []
}
}
}
},
"button": {
"type": "object",
"title": "Button interface description",
"description": "Describes properties of the button interface provided by this device.",
"properties": {
"count": {
"title": "Number of sensors/channels",
"description": "number of button sensors reported",
"type": "integer",
"minimum": 1
}
}
}
},
"defaultProperties": []
},
"semantic": {
"title": "Semantic alias tree",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/aliasNode"
}
},
"automaticAliases": {
"title": "Automatically-suggested (absolute) aliases",
"description": "If no automatic (of greater priority) or user-specified (defaulting to high priority) alias exists at the given path, it will automatically be created. A priority may optionally be specified.",
"type": "object"
}
}
}