From 9e263201a3303efa9411fdb00a5e4e17758fb372 Mon Sep 17 00:00:00 2001 From: "GLEN TURNER (8GT6)" <8gt6@queensu.ca> Date: Mon, 1 Jun 2015 09:12:32 -0400 Subject: [PATCH] moved files around to make it more user friendly --- .../HTML/RobotDisplayPanel.html | 2 +- {include => ProjectFiles}/js/ros_scripts.js | 17 +++++++++++ {include => ProjectFiles}/js/update_guis.js | 17 +++++++++++ index.html | 28 +++++++++++++------ 4 files changed, 55 insertions(+), 9 deletions(-) rename RobotDisplayPanel.html => ProjectFiles/HTML/RobotDisplayPanel.html (94%) rename {include => ProjectFiles}/js/ros_scripts.js (88%) rename {include => ProjectFiles}/js/update_guis.js (86%) diff --git a/RobotDisplayPanel.html b/ProjectFiles/HTML/RobotDisplayPanel.html similarity index 94% rename from RobotDisplayPanel.html rename to ProjectFiles/HTML/RobotDisplayPanel.html index 38a8c8a..4f664f8 100644 --- a/RobotDisplayPanel.html +++ b/ProjectFiles/HTML/RobotDisplayPanel.html @@ -2,7 +2,7 @@
- Example Pannel Heading + Example Pannel Heading My Changes
diff --git a/include/js/ros_scripts.js b/ProjectFiles/js/ros_scripts.js similarity index 88% rename from include/js/ros_scripts.js rename to ProjectFiles/js/ros_scripts.js index fe88ebc..7cb83b4 100644 --- a/include/js/ros_scripts.js +++ b/ProjectFiles/js/ros_scripts.js @@ -66,6 +66,23 @@ function getTopics() { return ros.topics }; +function getNodes() { + + var topicsClient = new ROSLIB.Service({ + ros : ros, + name : '/rosapi/nodes', + serviceType : '/rosapi/nodes' + }); + + var request = new ROSLIB.ServiceRequest(); + + topicsClient.callService(request, function(result) { + ros.nodes = result.nodes; + }); + + return ros.nodes +}; + function getTime() { var topicsClient = new ROSLIB.Service({ diff --git a/include/js/update_guis.js b/ProjectFiles/js/update_guis.js similarity index 86% rename from include/js/update_guis.js rename to ProjectFiles/js/update_guis.js index 09dce81..1d966d2 100644 --- a/include/js/update_guis.js +++ b/ProjectFiles/js/update_guis.js @@ -50,8 +50,25 @@ function updateTopicsGUI() }; +function updateNodesGUI() +{ + + nodes = getNodes() + if(nodes != null){ + var innerHTML = ""; + for (var i = 0; i < nodes.length; i++ ) + { + innerHTML = innerHTML.concat(nodes[i]); + innerHTML = innerHTML.concat("
"); + } + document.getElementById("ROSNodes").innerHTML = innerHTML; + } + +}; + window.setInterval(function(){ updateTopicsGUI() + updateNodesGUI() }, 500); function validateForm() diff --git a/index.html b/index.html index bbb3ef2..572f3d8 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ @@ -27,15 +27,15 @@ - - + + - + @@ -84,15 +84,15 @@
-
+
@@ -100,7 +100,6 @@
-
ROS Topics @@ -112,6 +111,19 @@
+ +
+
+ ROS Nodes +
+
+ +
+ N/A +
+
+
+