-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
51 lines (43 loc) · 1.01 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<!-- <link rel='stylesheet' href='/stylesheets/style.css' /> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.js"></script>
</head>
<body>
<h1>socket intel</h1>
<script>
var socket = io.connect('http://ec2-54-204-81-60.compute-1.amazonaws.com:3579/'); // 連線至伺服器
// socket.on('news', function (data) {
// console.log(data);
// socket.emit('event', { my: 'data' });
// });
// socket.emit('intelToSocket', {
// "seq": 1,
// "pos1": -0.93,
// "pos2": -4.57055,
// "pos3": 0.64278,
// "ori1": 0.98953,
// "ori2": -0.13628,
// "ori3": -0.04750,
// "ori4": 1.37925,
// });
console.log('ok')
var tt = 10;
function timego(){
socket.emit('intelToSocket', [{
"seq": 1,
"pos1": -0.93,
"pos2": -4.57055,
"pos3": 0.64278,
"ori1": 0.98953,
"ori2": -0.13628,
"ori3": -0.04750,
"ori4": 1.37925,
}]);
};
var timer = window.setInterval("timego()",3000);
</script>
</body>
</html>