diff --git a/coordinator/coordinator.html b/coordinator/coordinator.html index f72df3e..6f90ae4 100644 --- a/coordinator/coordinator.html +++ b/coordinator/coordinator.html @@ -4,13 +4,13 @@ Select Operation Mode
- - -
@@ -20,10 +20,10 @@ Hardware Commands
- -
@@ -33,10 +33,10 @@ Teaching Mode Operations
- -
@@ -47,19 +47,19 @@ Execution Mode Operations
- - - +
@@ -77,10 +77,10 @@ Execution Recording Operations
- -
diff --git a/coordinator/js/ros_scripts.js b/coordinator/js/ros_scripts.js index a09b009..2ec4233 100644 --- a/coordinator/js/ros_scripts.js +++ b/coordinator/js/ros_scripts.js @@ -1,3 +1,6 @@ + + + /////////////////////////////////////////////////////////////////////////////////// // Publishers /////////////////////////////////////////////////////////////////////////////////// @@ -8,10 +11,35 @@ //////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////// // Subscribers //////////////////////////////////////////////////////////////// +// Operation Mode +var modeStatus = new ROSLIB.Topic({ + ros : ros, + name : '/aescape/mode/status', + messageType : 'std_msgs/String' +}); + +modeStatus.subscribe(function(message) { + document.getElementById("standbyModeButton").className = "btn btn-primary" + document.getElementById("teachingModeButton").className = "btn btn-primary" + document.getElementById("executionModeButton").className = "btn btn-primary" + + + if (message.data === "standby") { + document.getElementById("standbyModeButton").className = "btn btn-success" + } else if (message.data === "teach") + { + document.getElementById("teachingModeButton").className = "btn btn-primary btn-success" + } else if (message.data === "execution") + { + document.getElementById("executionModeButton").className = "btn btn-primary btn-success" + } +}); + ////////////////////////////////////////////////////////////////