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 = "