Skip to content

Commit ad430c9

Browse files
authored
add example schemas as separate files (#866)
1 parent 50ce815 commit ad430c9

6 files changed

Lines changed: 2317 additions & 0 deletions

File tree

Lines changed: 375 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,375 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Self-Driving Vehicle",
4+
"description": "A JSON schema for configuration of autonomous vehicles",
5+
"type": "object",
6+
"$defs": {
7+
"Point": {
8+
"title": "Point in the 2D plane",
9+
"description": "Position in absolute coordinates",
10+
"type": "object",
11+
"properties": {
12+
"x": {
13+
"type": "number",
14+
"description": "X-coordinate of the starting location."
15+
},
16+
"y": {
17+
"type": "number",
18+
"description": "Y-coordinate of the starting location."
19+
}
20+
},
21+
"required": [
22+
"x",
23+
"y"
24+
],
25+
"additionalProperties": false
26+
},
27+
"WaypointReference": {
28+
"type": "string",
29+
"title": "Name of a waypoint",
30+
"description": "Must a waypoint defined in the set of waypoints.",
31+
"pattern": "^[A-Z][a-z]+[0-9]*$"
32+
},
33+
"SensorDefinition": {
34+
"type": "object",
35+
"properties": {
36+
"name": {
37+
"type": "string",
38+
"description": "Name of the radar sensor.",
39+
"pattern": "Sensor(0[1-9]|1[0-9]|20)$",
40+
"title": "SensorName"
41+
},
42+
"type": {
43+
"type": "string",
44+
"description": "Type of the sensor.",
45+
"enum": [
46+
"radar",
47+
"lidar",
48+
"ultrasonic"
49+
]
50+
},
51+
"range": {
52+
"type": "number",
53+
"description": "Maximum range of the sensor. Unit in mm",
54+
"examples": [
55+
"400"
56+
],
57+
"title": "SensorRange"
58+
},
59+
"position": {
60+
"description": "Position of the radar sensor relative to the vehicle's center.",
61+
"$ref": "#/$defs/Point",
62+
"title": "SensorPosition"
63+
}
64+
},
65+
"required": [
66+
"name",
67+
"range",
68+
"position"
69+
],
70+
"additionalProperties": false
71+
}
72+
},
73+
"additionalProperties": false,
74+
"properties": {
75+
"SimulationName": {
76+
"type": "string",
77+
"description": "Name of the simulation.",
78+
"pattern": "^Sim_.",
79+
"title": "SimulationName"
80+
},
81+
"SelfDrivingVehicle": {
82+
"type": "object",
83+
"properties": {
84+
"StartingLocation": {
85+
"title": "Starting Location",
86+
"description": "The starting location of the self-driving vehicle.",
87+
"$ref": "#/$defs/Point"
88+
},
89+
"Destination": {
90+
"title": "Destination",
91+
"description": "The destination of the self-driving vehicle.",
92+
"$ref": "#/$defs/Point"
93+
},
94+
"PlanningAlgorithm": {
95+
"type": "string",
96+
"description": "The algorithms used for route planning.",
97+
"enum": [
98+
"A* search",
99+
"Dijkstra",
100+
"Rapidly Random Tree (RRT)"
101+
],
102+
"title": "PlanningAlgorithm"
103+
},
104+
"Sensors": {
105+
"description": "Set of sensors installed on the self-driving vehicle.",
106+
"type": "array",
107+
"items": {
108+
"$ref": "#/$defs/SensorDefinition"
109+
}
110+
},
111+
"VehicleType": {
112+
"type": "string",
113+
"description": "Levels of the Self-driving vehicle. Level 1 is the lowest level of automation and Level 6 is the highest level of automation.",
114+
"enum": [
115+
"Level 1",
116+
"Level 2",
117+
"Level 3",
118+
"Level 4",
119+
"Level 5",
120+
"Level 6"
121+
]
122+
},
123+
"PassengerCapacity": {
124+
"type": "integer",
125+
"description": "Maximum number of passengers the vehicle can carry.",
126+
"minimum": 1,
127+
"exclusiveMaximum": 10,
128+
"title": "Passenger capacity"
129+
},
130+
"MaxSpeed": {
131+
"type": "integer",
132+
"description": "Maximum speed of the vehicle. Unit in km/h. Must be a multiple of 10.",
133+
"minimum": 0,
134+
"maximum": 480,
135+
"multipleOf": 10
136+
},
137+
"is4-Wheel-Drive": {
138+
"type": "boolean",
139+
"description": "if the car is a 4 wheel driven model",
140+
"title": "is4-Wheel-Drive",
141+
"default": false
142+
}
143+
},
144+
"required": [
145+
"StartingLocation",
146+
"PlanningAlgorithm",
147+
"Sensors",
148+
"VehicleType"
149+
],
150+
"title": "SelfDrivingVehicle"
151+
},
152+
"Environment": {
153+
"type": "object",
154+
"properties": {
155+
"Weather": {
156+
"type": "string",
157+
"description": "Current weather conditions",
158+
"enum": [
159+
"sunny",
160+
"rainy",
161+
"cloudy"
162+
],
163+
"title": "Weather"
164+
},
165+
"Temperature": {
166+
"type": "number",
167+
"description": "Current temperature in Celsius.",
168+
"title": "Temperature"
169+
},
170+
"Humidity": {
171+
"type": "integer",
172+
"description": "Relative humidity as a percentage.",
173+
"minimum": 0,
174+
"maximum": 100,
175+
"title": "Humidity"
176+
}
177+
},
178+
"required": [
179+
"Weather"
180+
],
181+
"additionalProperties": {
182+
"type": "string",
183+
"description": "Additional environment properties."
184+
}
185+
},
186+
"Vehicles": {
187+
"type": "object",
188+
"description": "Set of vehicles.",
189+
"propertyNames": {
190+
"type": "string",
191+
"minLength": 1,
192+
"maxLength": 20,
193+
"pattern": "^[a-z]+[0-9]*$"
194+
},
195+
"additionalProperties": {
196+
"type": "object",
197+
"properties": {
198+
"VehicleType": {
199+
"type": "string",
200+
"enum": [
201+
"car",
202+
"truck",
203+
"bus"
204+
],
205+
"description": "Type of the vehicle.",
206+
"default": "car"
207+
},
208+
"PathToDrive": {
209+
"type": "array",
210+
"description": "List of coordinates representing the vehicle's path.",
211+
"items": {
212+
"$ref": "#/$defs/WaypointReference"
213+
},
214+
"additionalProperties": false,
215+
"title": "PathToDrive"
216+
},
217+
"DrivingSpeed": {
218+
"type": "number",
219+
"description": "Average driving speed of the vehicle.",
220+
"minimum": 0,
221+
"maximum": 480,
222+
"multipleOf": 10,
223+
"title": "Driving Speed"
224+
},
225+
"IsElectric": {
226+
"type": "boolean",
227+
"description": "if the car is an electric model",
228+
"default": false
229+
},
230+
"DriverBehavior": {
231+
"type": "object",
232+
"description": "Driver behavior of the vehicle.",
233+
"properties": {
234+
"AggressivenessFactor": {
235+
"type": "number",
236+
"description": "Aggressiveness factor of the driver. This influences e.g. the acceleration and deceleration of the vehicle and the likelihood of overtaking other vehicles.",
237+
"minimum": 0,
238+
"maximum": 1
239+
},
240+
"ReactionTime": {
241+
"type": "number",
242+
"description": "Reaction time of the driver in ms. This influences e.g. the reaction time to obstacles and traffic lights.",
243+
"minimum": 0,
244+
"maximum": 1000
245+
},
246+
"Distraction": {
247+
"type": "number",
248+
"description": "Distraction factor of the driver. This influences e.g. the likelihood of the driver being distracted by a phone call or a passenger.",
249+
"minimum": 0,
250+
"maximum": 1
251+
},
252+
"Fatigue": {
253+
"type": "number",
254+
"description": "Fatigue factor of the driver. This influences e.g. the likelihood of the driver falling asleep.",
255+
"minimum": 0,
256+
"maximum": 1
257+
}
258+
}
259+
}
260+
},
261+
"required": [
262+
"VehicleType",
263+
"PathToDrive",
264+
"DrivingSpeed"
265+
],
266+
"additionalProperties": false
267+
}
268+
},
269+
"PedestrianGroups": {
270+
"type": "array",
271+
"description": "Array of pedestrian groups.",
272+
"items": {
273+
"type": "object",
274+
"properties": {
275+
"Count": {
276+
"type": "integer",
277+
"description": "Number of pedestrians.",
278+
"default": 1,
279+
"minimum": 1,
280+
"maximum": 1000
281+
},
282+
"Path": {
283+
"type": "array",
284+
"description": "List of coordinates representing the pedestrian's path.",
285+
"items": {
286+
"$ref": "#/$defs/WaypointReference"
287+
},
288+
"minItems": 1
289+
},
290+
"Speed": {
291+
"type": "number",
292+
"description": "Average walking speed of the pedestrians in km/h.",
293+
"minimum": 0,
294+
"maximum": 10
295+
}
296+
},
297+
"additionalProperties": false,
298+
"required": [
299+
"Path",
300+
"Speed"
301+
]
302+
}
303+
},
304+
"Waypoints": {
305+
"type": "object",
306+
"description": "Set of waypoints. Each waypoint is defined by a name and a position. The name must consist of a capital letter followed by at least one lowercase letter and optionally a number.",
307+
"propertyNames": {
308+
"type": "string",
309+
"minLength": 1,
310+
"maxLength": 20,
311+
"pattern": "^[A-Z][a-z]+[0-9]*$"
312+
},
313+
"additionalProperties": {
314+
"type": "object",
315+
"description": "Position of the waypoint.",
316+
"properties": {
317+
"point": {
318+
"$ref": "#/$defs/Point"
319+
},
320+
"connectedWaypoints": {
321+
"type": "array",
322+
"description": "List of edges connected to the waypoint.",
323+
"items": {
324+
"type": "string",
325+
"description": "Name of the connected waypoint.",
326+
"pattern": "^[A-Z][a-z]+[0-9]*$"
327+
}
328+
},
329+
"waypointType": {
330+
"type": "string",
331+
"description": "Type of the waypoint.",
332+
"enum": [
333+
"street",
334+
"sidewalk",
335+
"bikeLane",
336+
"trafficLight",
337+
"stopSign",
338+
"pedestrianCrossing"
339+
],
340+
"default": "normal"
341+
}
342+
},
343+
"required": [
344+
"point"
345+
],
346+
"additionalProperties": false
347+
}
348+
},
349+
"SimulationSettings": {
350+
"type": "object",
351+
"properties": {
352+
"Duration": {
353+
"type": "number",
354+
"description": "Duration of the simulation in the specified time unit.",
355+
"minimum": 0
356+
},
357+
"TimeUnit": {
358+
"type": "string",
359+
"description": "Time unit for simulation duration.",
360+
"enum": [
361+
"seconds",
362+
"minutes",
363+
"hours"
364+
]
365+
}
366+
},
367+
"required": [
368+
"TimeUnit",
369+
"Duration"
370+
],
371+
"additionalProperties": false,
372+
"title": "Other simulation settings"
373+
}
374+
}
375+
}

0 commit comments

Comments
 (0)