diff --git a/coordinator/coordinator.html b/coordinator/coordinator.html index 75e0190..a105b88 100644 --- a/coordinator/coordinator.html +++ b/coordinator/coordinator.html @@ -20,12 +20,46 @@
- Hardware Commands + Franka Arm Status
+
+ Current Robot Status: + +
+

Other

+
+
+

Idle

+
+
+

Move

+
+
+

Guiding

+
+
+

Reflex

+
+
+

User Stopped

+
+
+

Automatic Error Recovery

+
+
+
+
+
+
+ Hardware Commands +
+
diff --git a/coordinator/js/ros_scripts.js b/coordinator/js/ros_scripts.js index 1233562..3702390 100644 --- a/coordinator/js/ros_scripts.js +++ b/coordinator/js/ros_scripts.js @@ -30,15 +30,15 @@ modeStatus.subscribe(function(message) { document.getElementById("executionModeButton").className = "btn btn-primary" - if (message.data === "stopped") { + if (message.data == "stopped") { document.getElementById("stoppedModeButton").className = "btn btn-warning" - } else if (message.data === "standby") + } else if (message.data == "standby") { document.getElementById("standbyModeButton").className = "btn btn-primary btn-success" - } else if (message.data === "teach") + } else if (message.data == "teach") { document.getElementById("teachingModeButton").className = "btn btn-primary btn-success" - } else if (message.data === "execution") + } else if (message.data == "execution") { document.getElementById("executionModeButton").className = "btn btn-primary btn-success" } @@ -55,7 +55,60 @@ bagPlayingTopic.subscribe(function(message) { document.getElementById("bagPlayingText").innerHTML = message.data }); +// FrankaState +var frankaStatus = new ROSLIB.Topic({ + ros : ros, + name : '/franka_state_controller/franka_states', + messageType : 'franka_msgs/FrankaState' +}); +frankaStatus.subscribe(function(message) { + document.getElementById("frankaModeOther").className = "label label-default" + document.getElementById("frankaModeIdle").className = "label label-default" + document.getElementById("frankaModeMove").className = "label label-default" + document.getElementById("frankaModeGuiding").className = "label label-default" + document.getElementById("frankaModeReflex").className = "label label-default" + document.getElementById("frankaModeUserStopped").className = "label label-default" + document.getElementById("frankaModeErrorRecovery").className = "label label-default" + document.getElementById("fixFrankaButton").className = "btn btn-primary" + + if (message.robot_mode == 0) + { + document.getElementById("frankaModeOther").className = "label label-warning" + document.getElementById("fixFrankaButton").className = "btn btn-danger" + } + else if (message.robot_mode == 1) + { + document.getElementById("frankaModeIdle").className = "label label-warning" + document.getElementById("fixFrankaButton").className = "btn btn-danger" + } + else if (message.robot_mode == 2) + { + document.getElementById("frankaModeMove").className = "label label-warning" + document.getElementById("fixFrankaButton").className = "btn btn-success" + } + else if (message.robot_mode == 3) + { + document.getElementById("frankaModeGuiding").className = "label label-warning" + document.getElementById("fixFrankaButton").className = "btn btn-default" + } + else if (message.robot_mode == 4) + { + document.getElementById("frankaModeReflex").className = "label label-warning" + document.getElementById("fixFrankaButton").className = "btn btn-danger" + + } + else if (message.robot_mode == 5) + { + document.getElementById("frankaModeUserStopped").className = "label label-warning" + document.getElementById("fixFrankaButton").className = "btn btn-default" + } + else if (message.robot_mode == 6) + { + document.getElementById("frankaModeErrorRecovery").className = "label label-warning" + document.getElementById("fixFrankaButton").className = "btn btn-default" + } +}); //////////////////////////////////////////////////////////////// // Services