-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·22 lines (18 loc) · 805 Bytes
/
main.js
File metadata and controls
executable file
·22 lines (18 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// var IPaddress = 'ws:/'+'/'+window.location.hostname+':9090';
// console.log(IPaddress);
var rosServer = new ROSLIB.Ros({
// url : 'ws:/'+'/'+window.location.hostname+':9090'
url : 'ws://192.168.43.115:9090'
})
rosServer.on('connection',function(){
var status = document.getElementById('feedback');
status.innerHTML += "<p style='color:blue'>Status Message: Connected to websocket server.</p>";
});
rosServer.on('error',function(){
var status = document.getElementById('feedback');
status.innerHTML += "<p style='color:red'>Status Message: Error connecting to websocket server.</p>";
});
rosServer.on('close',function(){
var status = document.getElementById('feedback');
status.innerHTML += "<p style='color:#2b524f'>Status Message: Connection to websocket server closed.</p>";
});