-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
659 lines (546 loc) · 23.8 KB
/
index.html
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
<!DOCTYPE html>
<html>
<head>
<style>
/* Start with everything initially off */
#noObstacleTitle, #obstacleDetectedDriverBrakesTitle, #obstacleDetectedSystemBrakesTitle, #obstacleDetectedNoBrakesTitle,
#nothingDetectedVid1, #nothingDetectedVid2, #nothingDetectedVid3,
#nothingDetectedText1, #nothingDetectedText2, #nothingDetectedText3,
#driverBrakesVid1, #driverBrakesVid2, #driverBrakesVid3, #driverBrakesVid4,
#driverBrakesText1, #driverBrakesText2, #driverBrakesText3, #driverBrakesText4,
#systemBrakesVid1, #systemBrakesVid2, #systemBrakesVid3, #systemBrakesVid4, #systemBrakesVid5,
#systemBrakesText1, #systemBrakesText2, #systemBrakesText3, #systemBrakesText4, #systemBrakesText5,
#noBrakingVid1, #noBrakingVid2, #noBrakingVid3, #noBrakingVid4,
#noBrakingText1, #noBrakingText2, #noBrakingText3, #noBrakingText4,
#ShowPreviousAssetButton, #ShowNextAssetButton {
display: none;
}
</style>
</head>
<body>
<div>
<h1>Team CDLM's PBAS Prototype</h1>
<h3>
Our prototype serves to demonstrate all of the functionality that has been built
into our Pedestrian Backup Assist System (PBAS). Please click the buttons below
to go through our different scenarios. There are 4 scenarios that we want to
depict with our prototype.
</h3>
<h4>
<ul>
<li>
<button
type = "button"
onclick = "showNoObstacleDetectdStart()"
id = "NoObstacleDetectedButtonStart">
No Obstacle Detected
</button>
</li>
<li>
<button
type = "button"
onclick = "showDriverBrakesStart()"
id = "DriverBrakesButtonStart">
Obstacle Detected and the Driver Brakes
</button>
</li>
<li>
<button
type = "button"
onclick = "showSystemBrakesStart()"
id = "SystemBrakesButtonStart">
Obstacle Detected and the System Brakes
</button>
</li>
<li>
<button
type = "button"
onclick = "showNoBrakingOccursStart()"
id = "NoBrakingOccursButtonStart">
Obstacle Detected and No Braking Occurs
</button>
</li>
</ul>
</h4>
<!-- No Obstacle Title -->
<p id="noObstacleTitle" >
No Obstacle Detected
</p>
<!-- Obstacle Detected Driver Brakes Title -->
<p id="obstacleDetectedDriverBrakesTitle" >
Obstacle Detected and the Driver Brakes
</p>
<!-- Obstacle Detected System Brakes Title -->
<p id="obstacleDetectedSystemBrakesTitle" >
Obstacle Detected and the System Brakes
</p>
<!-- Obstacle Detected No Brakes Title -->
<p id="obstacleDetectedNoBrakesTitle" >
Obstacle Detected and No Braking Occurs
</p>
<!-- Nothing detected pic -->
<video width="320" height="240" id="nothingDetectedVid1" controls >
<source
src="./CSE870_ProjectVideos/NoObstacleDetected/NoObstacleDetected1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="nothingDetectedVid2" controls >
<source
src="./CSE870_ProjectVideos/NoObstacleDetected/NoObstacleDetected2.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="nothingDetectedVid3" controls >
<source
src="./CSE870_ProjectVideos/NoObstacleDetected/NoObstacleDetected3.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<!-- Driver Brakes -->
<video width="320" height="240" id="driverBrakesVid1" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedDriverBrake/ObstacleDetectedDriverBrake1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="driverBrakesVid2" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedDriverBrake/ObstacleDetectedDriverBrake2.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="driverBrakesVid3" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedDriverBrake/ObstacleDetectedDriverBrake3.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="driverBrakesVid4" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedDriverBrake/ObstacleDetectedDriverBrake4.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<!-- System Brakes -->
<video width="320" height="240" id="systemBrakesVid1" controls >
<source src="./CSE870_ProjectVideos/SystemStops/SystemStops1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="systemBrakesVid2" controls >
<source src="./CSE870_ProjectVideos/SystemStops/SystemStops2.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="systemBrakesVid3" controls >
<source src="./CSE870_ProjectVideos/SystemStops/SystemStops3.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="systemBrakesVid4" controls >
<source src="./CSE870_ProjectVideos/SystemStops/SystemStops4.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="systemBrakesVid5" controls >
<source src="./CSE870_ProjectVideos/SystemStops/SystemStops5.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<!-- No Brake -->
<video width="320" height="240" id="noBrakingVid1" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedNoBrake/ObstacleDetectedNoBrake1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="noBrakingVid2" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedNoBrake/ObstacleDetectedNoBrake2.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="noBrakingVid3" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedNoBrake/ObstacleDetectedNoBrake3.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video width="320" height="240" id="noBrakingVid4" controls >
<source
src="./CSE870_ProjectVideos/ObstacleDetectedNoBrake/ObstacleDetectedNoBrake4.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<!-- Nothing detected text -->
<p id="nothingDetectedText1">
The driver shifts the gear into reverse.
The VSES recognizes change in vehicle state and starts the PBAS.
The camera and distance sensor turns on and the video feed is displayed on the infotainment console.
The guiding lines are overlaid on the video feed.
</p>
<p id="nothingDetectedText2">
The driver backs up with no obstacle detected.
</p>
<p id="nothingDetectedText3">
The driver completes their backing event and continues operation of the vehicle as normal.
</p>
<!-- Driver Brakes text-->
<p id="driverBrakesText1">
The driver shifts the gear into reverse.
The VSES recognizes change in vehicle state and starts the PBAS.
The camera and distance sensor turns on and the video feed is displayed on the infotainment console.
The guiding lines are overlaid on the video feed.
</p>
<p id="driverBrakesText2">
The driver backs up the vehicle.
</p>
<p id="driverBrakesText3">
An obstacle moves into the path of the vehicle and is detected.
The obstacle detection graphic is displayed over the obstacle on the infotainment console.
The aural alert is played and the steering wheel rumbles.
The warnings notifies the driver in time, and the driver engages the brake.
</p>
<p id="driverBrakesText4">
The obstacle moves outside the path of the vehicle.
The driver completes their backing event and continues operation of the vehicle as normal.
</p>
<!-- System Brakes Text -->
<p id="systemBrakesText1">
The driver shifts the gear into reverse.
The VSES recognizes change in vehicle state and starts the PBAS.
The camera and distance sensor turns on and the video feed is displayed on the infotainment console.
The guiding lines are overlaid on the video feed.
</p>
<p id="systemBrakesText2">
The driver backs up the vehicle.
</p>
<p id="systemBrakesText3">
An obstacle moves into the path of the vehicle and is detected.
The obstacle detection graphic is displayed over the obstacle on the infotainment console.
The aural alert is played and the steering wheel rumbles.
Since the obstacle was too close to the vehicle and in the critical distance zone, the system engaged the car brakes without driver input.
</p>
<p id="systemBrakesText4">
The obstacle moves outside of the critical distance zones, which allows the system to give the driver back control.
</p>
<p id="systemBrakesText5">
The driver completes their backing event and continues operation of the vehicle as normal.
</p>
<!-- No Braking Text-->
<p id="noBrakingText1">
The driver shifts the gear into reverse.
The VSES recognizes change in vehicle state and starts the PBAS.
The camera and distance sensor turns on and the video feed is displayed on the infotainment console.
The guiding lines are overlaid on the video feed.
</p>
<p id="noBrakingText2">
The driver backs up the vehicle.
</p>
<p id="noBrakingText3">
An obstacle is detected and seen by the system.
The obstacle moves outside the path of the vehicle.
</p>
<p id="noBrakingText4">
The driver completes their backing event and continues operation of the vehicle as normal.
</p>
<!-- Previous button for nothing detected subsection -->
<button
type = "button"
onclick = "showPreviousAsset()"
id = "ShowPreviousAssetButton">
Previous
</button>
<!-- Next button for nothing detected subsection -->
<button
type = "button"
onclick = "showNextAsset()"
id = "ShowNextAssetButton">
Next
</button>
</div>
<script>
var noObstacleDetectedAssets = {
"nothingDetectedVid1": {
"display": "none",
"hasNext": true,
"hasPrevious": false,
"textId": "nothingDetectedText1",
"textVisibility": "none"
},
"nothingDetectedVid2": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "nothingDetectedText2",
"textVisibility": "none"
},
"nothingDetectedVid3": {
"display": "none",
"hasNext": false,
"hasPrevious": true,
"textId": "nothingDetectedText3",
"textVisibility": "none"
}
};
var driverBrakesAssets = {
"driverBrakesVid1": {
"display": "none",
"hasNext": true,
"hasPrevious": false,
"textId": "driverBrakesText1",
"textVisibility": "none"
},
"driverBrakesVid2": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "driverBrakesText2",
"textVisibility": "none"
},
"driverBrakesVid3": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "driverBrakesText3",
"textVisibility": "none"
},
"driverBrakesVid4": {
"display": "none",
"hasNext": false,
"hasPrevious": true,
"textId": "driverBrakesText4",
"textVisibility": "none"
}
};
var systemBrakesAssets = {
"systemBrakesVid1": {
"display": "none",
"hasNext": true,
"hasPrevious": false,
"textId": "systemBrakesText1",
"textVisibility": "none"
},
"systemBrakesVid2": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "systemBrakesText2",
"textVisibility": "none"
},
"systemBrakesVid3": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "systemBrakesText3",
"textVisibility": "none"
},
"systemBrakesVid4": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "systemBrakesText4",
"textVisibility": "none"
},
"systemBrakesVid5": {
"display": "none",
"hasNext": false,
"hasPrevious": true,
"textId": "systemBrakesText5",
"textVisibility": "none"
}
};
var noBrakingAssets = {
"noBrakingVid1": {
"display": "none",
"hasNext": true,
"hasPrevious": false,
"textId": "noBrakingText1",
"textVisibility": "none"
},
"noBrakingVid2": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "noBrakingText2",
"textVisibility": "none"
},
"noBrakingVid3": {
"display": "none",
"hasNext": true,
"hasPrevious": true,
"textId": "noBrakingText3",
"textVisibility": "none"
},
"noBrakingVid4": {
"display": "none",
"hasNext": false,
"hasPrevious": true,
"textId": "noBrakingText4",
"textVisibility": "none"
}
};
var userChoseNoObstacleDetected = false;
var userChoseDriverBrakes= false;
var userChoseSystemBrakes= false;
var userChoseNoBraking = false;
function showNoObstacleDetectdStart() {
// Show the correct picture
turnOffAllAssets();
// Show Title
document.getElementById( "noObstacleTitle" ).style.display = "block";
// Turn on the initial video
noObstacleDetectedAssets["nothingDetectedVid1"]["display"] = "block";
document.getElementById('nothingDetectedVid1').style.display = noObstacleDetectedAssets["nothingDetectedVid1"]["display"];
// Turn on the initial text
noObstacleDetectedAssets["nothingDetectedVid1"]["textVisibility"] = "block";
document.getElementById( noObstacleDetectedAssets["nothingDetectedVid1"]["textId"] ).style.display = noObstacleDetectedAssets["nothingDetectedVid1"]["textVisibility"];
HandleNextPreviousButtons();
// Keep track of which option the user chose
HandleUserSelection( "noObstacleDetected" );
}
function showDriverBrakesStart() {
// Show the correct picture
turnOffAllAssets();
// Show Title
document.getElementById( "obstacleDetectedDriverBrakesTitle").style.display = "block";
// Turn on the initial video
driverBrakesAssets["driverBrakesVid1"]["display"] = "block";
document.getElementById('driverBrakesVid1').style.display = driverBrakesAssets["driverBrakesVid1"]["display"];
// Turn on the initial text
driverBrakesAssets["driverBrakesVid1"]["textVisibility"] = "block";
document.getElementById( driverBrakesAssets["driverBrakesVid1"]["textId"] ).style.display = driverBrakesAssets["driverBrakesVid1"]["textVisibility"];
HandleNextPreviousButtons();
// Keep track of which option the user chose
HandleUserSelection( "driverBrakes" );
}
function showSystemBrakesStart() {
// Show the correct picture
turnOffAllAssets();
// Show Title
document.getElementById( "obstacleDetectedSystemBrakesTitle" ).style.display = "block";
// Turn on the video
systemBrakesAssets["systemBrakesVid1"]["display"] = "block";
document.getElementById('systemBrakesVid1').style.display = systemBrakesAssets["systemBrakesVid1"]["display"];
// Turn on the accompanying text
systemBrakesAssets["systemBrakesVid1"]["textVisibility"] = "block";
document.getElementById( systemBrakesAssets["systemBrakesVid1"]["textId"] ).style.display = systemBrakesAssets["systemBrakesVid1"]["textVisibility"];
HandleNextPreviousButtons();
// Keep track of which option the user chose
HandleUserSelection( "systemBrakes" );
}
function showNoBrakingOccursStart() {
// Show the correct picture
turnOffAllAssets();
// Show title
document.getElementById( "obstacleDetectedNoBrakesTitle" ).style.display = "block";
// Turn on the original video
noBrakingAssets["noBrakingVid1"]["display"] = "block";
document.getElementById('noBrakingVid1').style.display = noBrakingAssets["noBrakingVid1"]["display"];
// Turn on the text
noBrakingAssets["noBrakingVid1"]["textVisibility"] = "block";
document.getElementById( noBrakingAssets["noBrakingVid1"]["textId"] ).style.display = noBrakingAssets["noBrakingVid1"]["textVisibility"];
HandleNextPreviousButtons();
// Keep track of which option the user chose
HandleUserSelection( "noBraking" );
}
function showNextAsset() {
let assetsToUse = userChoseNoObstacleDetected ? noObstacleDetectedAssets :
userChoseDriverBrakes ? driverBrakesAssets :
userChoseSystemBrakes ? systemBrakesAssets : noBrakingAssets;
// If there is another asset next, show it
let getNext, movedAlready = false;
Object.keys( assetsToUse ).forEach ( asset => {
let currentAsset = assetsToUse[asset];
if ( getNext && !movedAlready ) {
// Turn the video on
document.getElementById( asset ).style.display = "block";
currentAsset["display"] = "block";
// Turn the text on
document.getElementById( currentAsset["textId"] ).style.display = "block";
currentAsset["textVisibility"] = "block";
if ( !currentAsset["hasNext"] ){
document.getElementById('ShowNextAssetButton').style.display = "none";
}
if ( currentAsset["hasPrevious"] ){
document.getElementById('ShowPreviousAssetButton').style.display = "inline-block";
}
movedAlready = true;
}
if ( currentAsset["display"] == "block" && !movedAlready ) {
if ( currentAsset["hasNext"] ) {
getNext = true;
// Turn the video off
document.getElementById( asset ).style.display = "none";
currentAsset["display"] = "none";
// Turn the text off
document.getElementById( currentAsset["textId"] ).style.display = "none";
currentAsset["textVisibility"] = "none";
}
}
});
}
function showPreviousAsset() {
let assetsToUse = userChoseNoObstacleDetected ? noObstacleDetectedAssets :
userChoseDriverBrakes ? driverBrakesAssets :
userChoseSystemBrakes ? systemBrakesAssets : noBrakingAssets;
// If there is another asset previously, show it
let getPrevious, movedAlready = false;
Object.keys( assetsToUse ).reverse().forEach ( asset => {
let currentAsset = assetsToUse[asset];
if ( getPrevious && !movedAlready ) {
// Turn the video on
document.getElementById( asset ).style.display = "block";
currentAsset["display"] = "block";
// Turn the text on
document.getElementById( currentAsset["textId"] ).style.display = "block";
currentAsset["textVisibility"] = "block";
if ( !currentAsset["hasPrevious"] ){
document.getElementById('ShowPreviousAssetButton').style.display = "none";
}
if ( currentAsset["hasNext"] ) {
document.getElementById('ShowNextAssetButton').style.display = "inline-block";
}
movedAlready = true;
}
if ( currentAsset["display"] == "block" && !movedAlready ) {
if ( currentAsset["hasPrevious"] ) {
getPrevious = true;
// Turn the video off
document.getElementById( asset ).style.display = "none";
currentAsset["display"] = "none";
// Turn the text off
document.getElementById( currentAsset["textId"] ).style.display = "none";
currentAsset["textVisibility"] = "none";
}
}
});
}
function turnOffAllAssets() {
document.getElementById( "noObstacleTitle" ).style.display = "none";
document.getElementById( "obstacleDetectedDriverBrakesTitle" ).style.display = "none";
document.getElementById( "obstacleDetectedSystemBrakesTitle" ).style.display = "none";
document.getElementById( "obstacleDetectedNoBrakesTitle" ).style.display = "none";
Object.keys( noObstacleDetectedAssets ).forEach ( asset => {
noObstacleDetectedAssets[asset]["display"] = "none";
document.getElementById( asset ).style.display = "none";
noObstacleDetectedAssets[asset]["textVisibility"] = "none";
document.getElementById( noObstacleDetectedAssets[asset]["textId"] ).style.display = "none";
});
Object.keys( driverBrakesAssets ).forEach ( asset => {
driverBrakesAssets[asset]["display"] = "none";
document.getElementById( asset ).style.display = "none";
driverBrakesAssets[asset]["textVisibility"] = "none";
document.getElementById( driverBrakesAssets[asset]["textId"] ).style.display = "none";
});
Object.keys( systemBrakesAssets ).forEach ( asset => {
systemBrakesAssets[asset]["display"] = "none";
document.getElementById( asset ).style.display = "none";
systemBrakesAssets[asset]["textVisibility"] = "none";
document.getElementById( systemBrakesAssets[asset]["textId"] ).style.display = "none";
});
Object.keys( noBrakingAssets ).forEach ( asset => {
noBrakingAssets[asset]["display"] = "none";
document.getElementById( asset ).style.display = "none";
noBrakingAssets[asset]["textVisibility"] = "none";
document.getElementById( noBrakingAssets[asset]["textId"] ).style.display = "none";
});
}
function HandleNextPreviousButtons() {
document.getElementById('ShowNextAssetButton').style.display = "inline-block";
document.getElementById('ShowPreviousAssetButton').style.display = "none";
}
function HandleUserSelection( userSelection ) {
userChoseNoObstacleDetected = userSelection == "noObstacleDetected";
userChoseDriverBrakes = userSelection == "driverBrakes";
userChoseSystemBrakes = userSelection == "systemBrakes";
userChoseNoBraking = userSelection == "noBraking";
}
</script>
</body>
</html>