diff --git a/backend/js/ros_scripts.js b/backend/js/ros_scripts.js index 4b05717..410a3b1 100644 --- a/backend/js/ros_scripts.js +++ b/backend/js/ros_scripts.js @@ -115,62 +115,6 @@ bagNotifier.subscribe(function(message) { /////////////////////////////////////////////////////////////////////////////////// -ros.buildTopicList = function(fresh_topics) -{ - - // console.log(topics) -// fresh_topics = fresh_topics.sort(); - // First check that all our current topics are in the list of fresh_topics - for( var topic = 0; topic < ros.topics.length; topic ++) - { - - if (fresh_topics.indexOf(ros.topics[topic].name) > -1) - { - // We know that we have already found that topic so we don't need to remove it - } - else - { - // That topic is no longer being published so we need ro remove it - ros.topics.splice(topic,1); - } - } - - for (var topic =0; topic < fresh_topics.length; topic ++ ) - { - if (ros.topics.indexOfTopic(fresh_topics[topic]) > -1) - { - // We know that we have already found that topic so we don't need to re-add it - } - else - { - // We do not have that topic so we need to add it - // create the new topic - var new_topic = new Topic(fresh_topics[topic]); - // make sure to put in in the list in the order - ros.topics.push(new_topic); - - } - } - - ros.topics.sort(function(a, b) { - if ( a.name < b.name ) - return -1; - if ( a.name > b.name ) - return 1; - return 0; - }) - -}; - - -ros.getTopicsList = function() -{ - // var topicList = []; - return ros.topics; - -} - - // attept to connect to the ros master from the IP given orgrab it from the form ros.attemptConnection = function(ipAddress) { diff --git a/backend/js/update_guis.js b/backend/js/update_guis.js index 0764ada..f6173b8 100644 --- a/backend/js/update_guis.js +++ b/backend/js/update_guis.js @@ -60,40 +60,26 @@ function updateVoltage(voltage) function updateTopicsGUI() { - ros.getTopics(ros.buildTopicList); + ros.getTopics(function(result) + { + ros.topics = result; + }); - var topics = ros.getTopicsList(); + var topics = ros.topics; + topics.sort() if(topics != null){ var innerHTML = ""; for (var i = 0; i < topics.length; i++ ) { - innerHTML = innerHTML.concat(generateTopicCheckbox(topics[i])); + innerHTML = innerHTML.concat(topics[i]); + innerHTML = innerHTML.concat("
"); } document.getElementById("ROSTopics").innerHTML = innerHTML; } }; -function generateTopicCheckbox(topic) -{ - var str = "
"; - var checked_str = "unchecked"; - if (topic.bag == true) - { - checked_str = "checked" - } - str =str.concat("
"); - return str; -}; - -function toggleToBag(topic_name) -{ - // if($.inArray(topic_name, ros.topics)) - ros.topics[ros.topics.indexOfTopic(topic_name)].bag = !ros.topics[ros.topics.indexOfTopic(topic_name)].bag ; -} function updateNodesGUI() { @@ -113,7 +99,6 @@ function updateNodesGUI() { innerHTML = innerHTML.concat(nodes[i]); innerHTML = innerHTML.concat("
"); - } document.getElementById("ROSNodes").innerHTML = innerHTML; } diff --git a/index.html b/index.html index 0fe8a0b..6dfd9a3 100644 --- a/index.html +++ b/index.html @@ -43,55 +43,27 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
-
-

ROS Display

+
+

Lab UI

- - -
- -
- ROS Bag -
-
-
-
- Bagfile name must not start with "/" -
- - - - -
-
-
-
- -
- - -
-
+
@@ -99,6 +71,34 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp + + +
+ +
+ ROS Bag +
+
+
+
+ Bagfile name must not start with "/" +
+ + + + +
+
+
+
+ +
+ +
@@ -106,7 +106,33 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp -
+
+
+
+ Predefined Masters Connections +
+
+ + + +
+
+
@@ -129,21 +155,22 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp + +
-
- ROS Topics. Checked topics will be bagged when "Start" is selected. + ROS Topics.
-
+
N/A
@@ -151,7 +178,7 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
- ROS Nodes + ROS Nodes.