-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
79 lines (73 loc) · 2.98 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
<!DOCTYPE html>
<html>
<head>
<title>Machine Vision Enabled Bot For Object Tracking</title>
<link rel="stylesheet" href='../static/style.css'/>
<style>
body {
text-align: center;
}
</style>
</head>
<body>
<h1>MVBOT Live Streaming</h1>
<h3><img src="{{ url_for('video_feed') }}" width="40%"></h3>
<hr>
<h5> PAN Angle: <button id="ul" onclick="window.location.href='/pan/-';">-</button> [ {{ panServoAngle }} ] <button id="ur" onclick="window.location.href='/pan/+';">+</button> </h5>
<h5> TILT Angle: <button id="ll" onclick="window.location.href='/tilt/-';">-</button> [ {{ tiltServoAngle }} ] <button id="lr" onclick="window.location.href='/tilt/+';">+</button> </h5>
<h5> <button id="fwd" onclick="window.location.href='/forward';">Forward</button></h5>
<h5> <button id="left" onclick="window.location.href='/left';">Left</button> <button id="stop" onclick="window.location.href='/stop';">Stop</button> <button id="right" onclick="window.location.href='/right';">Right</button> </h5>
<h5> <button id="rev" onclick="window.location.href='/reverse';">Reverse</button> </h5>
<h5> <button onclick="enableBtn();">Manual</button> <button onclick="disableBtn()">Automatic</button> </h5>
<hr>
<p> Testing Phase </p>
<script>
function disableBtn() {
document.getElementById("ul").disabled = true;
document.getElementById("ur").disabled = true;
document.getElementById("ll").disabled = true;
document.getElementById("lr").disabled = true;
document.getElementById("fwd").disabled = true;
document.getElementById("left").disabled = true;
document.getElementById("rev").disabled = true;
document.getElementById("stop").disabled = true;
document.getElementById("right").disabled = true;
}
function enableBtn() {
document.getElementById("ul").disabled = false;
document.getElementById("ur").disabled = false;
document.getElementById("ll").disabled = false;
document.getElementById("lr").disabled = false;
document.getElementById("fwd").disabled = false;
document.getElementById("left").disabled = false;
document.getElementById("rev").disabled = false;
document.getElementById("stop").disabled = false;
document.getElementById("right").disabled = false;
}
document.addEventListener('keypress',function runkey() {
var x = event.key;
if (x == "w" || x == "W")
window.location.href='/forward';
else if (x == "a" || x == "A")
window.location.href='/left';
else if(x == "s" || x == "S")
window.location.href='/reverse';
else if(x == "d" || x== "D")
window.location.href='/right';
else alert ("You pressed the some other key!");
})
document.onkeydown = checkKey;
function checkKey(e) {
e = e || window.event;
if (e.keyCode == '38')
window.location.href='/pan/+';
else if (e.keyCode == '40')
window.location.href='/pan/-';
else if (e.keyCode == '37')
window.location.href='/tilt/-';
else if (e.keyCode == '39')
window.location.href='/tilt/+';
}
</script>
</body>
</html>