Moved files around. ROS Display panel html is now back in the index file

This commit is contained in:
GLEN TURNER (8GT6)
2015-06-01 11:50:07 -04:00
parent cdd26f1427
commit 6d395c2bbe
7 changed files with 93 additions and 21 deletions

View File

@@ -1,8 +1,11 @@
var ros = new ROSLIB.Ros();
ros.topics = [];
ros.nodes = [];
ros.connectioninfo = ['ws://', '192', '168', '0', '100', '9090'];
// ros.connectionName = 'ws://localhost:9090';
ros.connectionName = 'ws://192.168.0.100:9090';
ros.connectionName = 'ws://192.168.0.100:9090';
// If there is an error on the backend, an 'error' emit will be emitted.
ros.on('error', function(error) {
document.getElementById("ConnectionIPForm").className = "form-group has-warning has-feedback";
@@ -10,6 +13,7 @@ ros.on('error', function(error) {
document.getElementById("ConnectionIPLabel").innerHTML = 'No connection';
document.getElementById("ConnectionButton").className = "btn btn-warning"
document.getElementById("rosbridgeconnection_badge").innerHTML = 'No connection';
document.getElementById("ROSNodes").innerHTML = "";
rosbridgeconnection_badge
console.log(error);192
@@ -24,10 +28,20 @@ ros.on('connection', function() {
document.getElementById("ConnectionButton").className = "btn btn-success"
ros.nodes = [];
ros.topics = [];
});
ros.on('close', function() {
console.log('Connection closed.');
document.getElementById("ConnectionIPForm").className = "form-group has-warning has-feedback";
document.getElementById("ConnectionIPLabel").innerHTML = 'Connection closed';
document.getElementById("ConnectionButton").className = "btn btn-warning"
document.getElementById("rosbridgeconnection_badge").innerHTML = 'Connection closed';
ros.nodes = [];
ros.topics = [];
});
// Create a connection to the rosbridge WebSocket server.
ros.connect(ros.connectionName);
@@ -59,11 +73,12 @@ function getTopics() {
var request = new ROSLIB.ServiceRequest();
// ros.topics = [];
topicsClient.callService(request, function(result) {
ros.topics = result.topics;
});
return ros.topics
return ros.topics;
};
function getNodes() {
@@ -76,11 +91,12 @@ function getNodes() {
var request = new ROSLIB.ServiceRequest();
// ros.nodes = [];
topicsClient.callService(request, function(result) {
ros.nodes = result.nodes;
});
return ros.nodes
return ros.nodes;
};
function getTime() {