Add controller mode status.

This commit is contained in:
David Walsh
2019-02-28 20:18:22 -05:00
parent a7e23c1231
commit 172afae8dd
2 changed files with 42 additions and 14 deletions

View File

@@ -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"
}
});
////////////////////////////////////////////////////////////////