-
+
Teaching Mode
-
+
Massage Mode
-
+
Ready Mode
-
+
Standby Mode
-
+
Stopped Mode
diff --git a/client/app/components/coordinator/js/ros_scripts.js b/client/app/components/coordinator/js/ros_scripts.js
index 6899c54..6ad79dd 100644
--- a/client/app/components/coordinator/js/ros_scripts.js
+++ b/client/app/components/coordinator/js/ros_scripts.js
@@ -60,112 +60,104 @@ class ArmControls
});
this.safetyStatusTopic.subscribe(this.safetyStatus.bind(this));
+ this.lastActiveButton = {
+ operationMode : null
+ };
}
+
// FrankaState
frankaStatus(message) {
- document.getElementById(this.namespace+"_frankaModeOther").className = "label label-default"
- document.getElementById(this.namespace+"_frankaModeIdle").className = "label label-default"
- document.getElementById(this.namespace+"_frankaModeMove").className = "label label-default"
- document.getElementById(this.namespace+"_frankaModeGuiding").className = "label label-default"
- document.getElementById(this.namespace+"_frankaModeReflex").className = "label label-default"
- document.getElementById(this.namespace+"_frankaModeUserStopped").className = "label label-default"
- document.getElementById(this.namespace+"_frankaModeErrorRecovery").className = "label label-default"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-primary"
-
- if (message.robot_mode == 0)
- {
- document.getElementById(this.namespace+"_frankaModeOther").className = "label label-warning"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-danger"
- }
- else if (message.robot_mode == 1)
- {
- document.getElementById(this.namespace+"_frankaModeIdle").className = "label label-warning"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-danger"
- }
- else if (message.robot_mode == 2)
- {
- document.getElementById(this.namespace+"_frankaModeMove").className = "label label-warning"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-success"
- }
- else if (message.robot_mode == 3)
- {
- document.getElementById(this.namespace+"_frankaModeGuiding").className = "label label-warning"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-default"
+ var frankaModeToButtonMap = {
+ 0 : "frankaModeOther",
+ 1 : "frankaModeIdle",
+ 2 : "frankaModeMove",
+ 3 : "frankaModeGuiding",
+ 4 : "frankaModeReflex",
+ 5 : "frankaModeUserStopped",
+ 6 : "frankaModeErrorRecovery"
}
- else if (message.robot_mode == 4)
- {
- document.getElementById(this.namespace+"_frankaModeReflex").className = "label label-warning"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-danger"
-
+ if(frankaModeLastActive && frankaModeLastActive != message.robot_mode) {
+ var frankaButton = frankaModeToButtonMap[frankaModeLastActive];
+ if (frankaButton) {
+ document.getElementById(this.namespace+"_"+frankaButton).getElementsByTagName("input")[0].checked = false;
+ document.getElementById(this.namespace+"_"+frankaButton).getElementsByTagName("input")[0].disabled = true;
+ }
}
- else if (message.robot_mode == 5)
- {
- document.getElementById(this.namespace+"_frankaModeUserStopped").className = "label label-warning"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-default"
- }
- else if (message.robot_mode == 6)
- {
- document.getElementById(this.namespace+"_frankaModeErrorRecovery").className = "label label-warning"
- document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-default"
+ var frankaButton = frankaModeToButtonMap[message.robot_mode];
+ if (frankaButton) {
+ document.getElementById(this.namespace+"_"+frankaButton).getElementsByTagName("input")[0].disabled = false;
+ document.getElementById(this.namespace+"_"+frankaButton).getElementsByTagName("input")[0].checked = true;
}
+ var frankaModeLastActive = message.robot_mode;
}
// Operation Mode
modeStatus(message) {
- document.getElementById(this.namespace+"_stoppedModeButton").className = "btn btn-secondary"
- document.getElementById(this.namespace+"_standbyModeButton").className = "btn btn-primary"
- document.getElementById(this.namespace+"_readyModeButton").className = "btn btn-primary"
- document.getElementById(this.namespace+"_teachingModeButton").className = "btn btn-primary"
- document.getElementById(this.namespace+"_executionModeButton").className = "btn btn-primary"
-
+ var operationModeToButtonMap = {
+ "stopped" : "stoppedModeButton",
+ "standby" : "standbyModeButton",
+ "teach" : "teachingModeButton",
+ "execution" : "executionModeButton",
+ "ready" : "readyModeButton"
+ }
+
if (this.namespace == "left")
{
document.getElementById("recordingStartButton").disabled = true
document.getElementById("executionStartButton").disabled = true
}
-
- if (message.data == "stopped")
+
+ if (message.data == "ready")
{
- document.getElementById(this.namespace+"_stoppedModeButton").className = "btn btn-warning"
- }
- else if (message.data == "standby")
- {
- document.getElementById(this.namespace+"_standbyModeButton").className = "btn btn-primary btn-success"
- }
- else if (message.data == "teach")
- {
- document.getElementById(this.namespace+"_teachingModeButton").className = "btn btn-primary btn-success"
- }
- else if (message.data == "execution")
- {
- document.getElementById(this.namespace+"_executionModeButton").className = "btn btn-primary btn-success"
- }
- else if (message.data == "ready")
- {
- document.getElementById(this.namespace+"_readyModeButton").className = "btn btn-primary btn-success"
-
if (this.namespace == "left")
{
document.getElementById("recordingStartButton").disabled = false
document.getElementById("executionStartButton").disabled = false
}
}
+
+
+ var operationModeLastActive = this.operationModeLastActive;
+
+ if(operationModeLastActive && operationModeLastActive != message.data) {
+ var operationModeButton = operationModeToButtonMap[operationModeLastActive];
+ if (operationModeButton) {
+ document.getElementById(this.namespace+"_"+operationModeButton).classList.remove("active");
+ }
+ }
+
+ var operationModeButton = operationModeToButtonMap[message.data];
+ if (operationModeButton) {
+ document.getElementById(this.namespace+"_"+operationModeButton).classList.add('active');
+ }
+
+ this.operationModeLastActive = message.data;
+
}
safetyStatus(message) {
- document.getElementById(this.namespace+"_safetyRunning").className = 'label label-default';
- document.getElementById(this.namespace+"_safetyStopped").className = 'label label-default';
-
- if (message.data == "stopped")
- {
- document.getElementById(this.namespace+"_safetyStopped").className = 'label label-danger';
- }
- else if (message.data == "running")
- {
- document.getElementById(this.namespace+"_safetyRunning").className = 'label label-success';
+ var safetyStatusToButtonMap = {
+ "stopped" : "safetyStopped",
+ "running" : "safetyRunning"
}
- };
+
+ if(safetyButtonLastActive && safetyButtonLastActive != message.data) {
+ var safetyButton = safetyStatusToButtonMap[safetyButtonLastActive];
+ if(safetyButton) {
+ document.getElementById(this.namespace+"_"+safetyButton).getElementsByTagName("input")[0].checked = false;
+ document.getElementById(this.namespace+"_"+safetyButton).getElementsByTagName("input")[0].disabled = true;
+ }
+ }
+
+ var safetyButton = safetyStatusToButtonMap[message.data];
+ if(safetyButton) {
+ document.getElementById(this.namespace+"_"+safetyButton).getElementsByTagName("input")[0].disabled = false;
+ document.getElementById(this.namespace+"_"+safetyButton).getElementsByTagName("input")[0].checked = true;
+ }
+
+ var safetyButtonLastActive = message.data;
+ }
}
var leftArmControls = new ArmControls('left');
@@ -197,9 +189,9 @@ robotiqDataTopic.subscribe(function(message) {
if ((Math.abs(force.x) > 0.5) || (Math.abs(force.y) > 0.5) || (Math.abs(force.z) > 0.5))
{
- document.getElementById("calibrateButton").className = "btn btn-danger"
+ //consider adding warning buttons
} else {
- document.getElementById("calibrateButton").className = "btn btn-default"
+ document.getElementById("calibrateButton").disabled = true;
}
});
@@ -214,14 +206,31 @@ var recordingBagTopic = new ROSLIB.Topic({
recordingBagTopic.subscribe(function(message) {
if (message.data == "stopped")
{
- document.getElementById("RecordingStatusLabel").innerHTML = 'Not Running';
- document.getElementById("RecordingStatusLabel").className = 'label label-warning';
+ //document.getElementById("RecordingStatusLabel").innerHTML = 'Not Running';
}
else if (message.data == "running")
{
- document.getElementById("RecordingStatusLabel").innerHTML = 'RUNNING!';
- document.getElementById("RecordingStatusLabel").className = 'label label-success';
+ //document.getElementById("RecordingStatusLabel").innerHTML = 'Running!';
}
+
+ var teachingModeToButtonMap = {
+ "stopped" : "recordingStopButton",
+ "running" : "recordingStartButton"
+ }
+
+ if(teachingModeLastActive && teachingModeLastActive != message.data) {
+ var teachingModeButton = teachingModeToButtonMap[teachingModeLastActive];
+ if (teachingModeButton) {
+ document.getElementById(teachingModeButton).classList.remove("active");
+ }
+ }
+
+ var teachingModeButton = teachingModeToButtonMap[message.data];
+ if (teachingModeButton) {
+ document.getElementById(teachingModeButton).classList.add("active");
+ }
+
+ var teachingModeLastActive = message.data;
});
// Executing Bag
@@ -234,14 +243,30 @@ var executingBagTopic = new ROSLIB.Topic({
executingBagTopic.subscribe(function(message) {
if (message.data == "stopped")
{
- document.getElementById("ExecutionStatusLabel").innerHTML = 'Not Running';
- document.getElementById("ExecutionStatusLabel").className = 'label label-warning';
+ //document.getElementById("ExecutionStatusLabel").innerHTML = 'Not Running';
}
else if (message.data == "running")
{
- document.getElementById("ExecutionStatusLabel").innerHTML = 'RUNNING!';
- document.getElementById("ExecutionStatusLabel").className = 'label label-success';
+ //document.getElementById("ExecutionStatusLabel").innerHTML = 'RUNNING!';
}
+ var executionModeToButtonMap = {
+ "stopped" : "executionStopButton",
+ "running" : "executionStartButton"
+ }
+
+ if(executionModeLastActive && executionModeLastActive != message.data) {
+ var executionModeButton = teachingModeToButtonMap[executionModeLastActive];
+ if (executionModeButton) {
+ document.getElementById(executionModeButton).classList.remove("active");
+ }
+ }
+
+ var executionModeButton = executionModeToButtonMap[message.data];
+ if (executionModeButton) {
+ document.getElementById(executionModeButton).classList.add("active");
+ }
+
+ var executionModeLastActive = message.data;
});
@@ -276,20 +301,6 @@ function triggerService(serviceName)
serviceType : 'std_srvs/Trigger'
});
- console.log("hello biatch");
- $(document).ready(function(){
- $.notify({
- message: "ROS request didn't go through!"
- }, {
- "placement" : {
- from: "bottom",
- align: "right"
- },
- type: 'danger',
- delay: 1000
- });
- });
-
var request = new ROSLIB.ServiceRequest({});
service.callService(request, function(result) {
@@ -297,8 +308,32 @@ function triggerService(serviceName)
+ serviceName
+ ': '
+ result.sum);
+ $(document).ready(function(){
+ $.notify({
+ message: "Request error: " + serviceName + ". " + result.sum
+ }, {
+ "placement" : {
+ from: "bottom",
+ align: "right"
+ },
+ type: 'success',
+ delay: 1000
+ });
+ });
}, function(error){
- console.log("errorored");
+ console.log("errored");
+ $(document).ready(function(){
+ $.notify({
+ message: "Request error: " + serviceName + ". " + result.sum
+ }, {
+ "placement" : {
+ from: "bottom",
+ align: "right"
+ },
+ type: 'danger',
+ delay: 1000
+ });
+ });
});
}
diff --git a/client/app/index.html b/client/app/index.html
index b0ae263..473aa42 100644
--- a/client/app/index.html
+++ b/client/app/index.html
@@ -6,6 +6,7 @@
+
@@ -23,6 +24,7 @@
+
diff --git a/client/app/main.css b/client/app/main.css
index f79b169..d304800 100644
--- a/client/app/main.css
+++ b/client/app/main.css
@@ -9,7 +9,8 @@ html, body {
padding: 0;
margin: 0;
background: #020625;
- color: #EDF0F4;
+ //color: #EDF0F4;
+ color: white;
}
.fill-container {
@@ -136,7 +137,8 @@ html, body {
.panel-heading, .panel-footer {
background-color: #020625 !important;
- color: #EDF0F4 !important;
+ //color: #EDF0F4 !important;
+ color: white !important;
text-align: center;
font-size: 14pt;
}
@@ -170,7 +172,8 @@ html, body {
.control-card .button-area > button {
height: 100%;
border-radius: 0;
- color: #EDF0F4;
+ //color: #EDF0F4;
+ color: white;
font-size : 14pt;
background: #182048;
}
@@ -182,7 +185,8 @@ html, body {
.status-container .action-button > button {
height: 100%;
border-radius: 0;
- color: #EDF0F4;
+ //color: #EDF0F4;
+ color: white;
font-size : 14pt;
background: #182048;
width: 100%;
@@ -202,7 +206,8 @@ html, body {
.nav-pills li a {
border-radius: 0;
- color: #EDF0F4;
+ //color: #EDF0F4;
+ color: white;
font-size : 16pt;
font-weight: 600;
background: #020625;
@@ -213,7 +218,8 @@ html, body {
}
.nav-pills>li.active>a, .nav-pills>li.active>a:focus, .nav-pills>li.active>a:hover, .nav>li>a:focus, .nav>li>a:hover{
- color: #EDF0F4;
+ //color: #EDF0F4;
+ color: white;
background: #182048;
}
@@ -279,7 +285,7 @@ html, body {
.panel.panel-horizontal > .panel-body {
height: auto;
padding: 0px;
- font-size: 12pt;
+ font-size: 14pt;
padding: 5px 10px;
}
@@ -288,8 +294,44 @@ html, body {
word-wrap: break-word;
}
+ button[class*="active"] {
+ //background-color: #085394 !important;
+ background-image: linear-gradient(#085394, #073763) !important;
+ }
+ button[class*="disabled"] {
+ background-color: #262b40 !important;
+ cursor: not-allowed;
+ pointer-events: none;
+ }
+ button[class*="danger"] {
+ background-image: linear-gradient(#b45f06, #783f04) !important;
+ background-image: linear-gradient(#990000, #660000) !important;
+ }
+
+ .status-container .robotiq .progress {
+ margin-bottom: 5px;
+ }
+
+ .status-container .robotiq .list-group-horizontal {
+ justify-content: center;
+ }
+
+ #recordingStartButton[active] {
+ animation: blinker 3s linear infinite;
+ }
+
+ #executionStartButton[active] {
+ animation: blinker 3s linear infinite;
+ }
+
+ @keyframes blinker {
+ 50% {
+ opacity: 0;
+ }
+ }
+
\ No newline at end of file
diff --git a/client/app/utilities/ros_scripts.js b/client/app/utilities/ros_scripts.js
index 1814286..bde2617 100644
--- a/client/app/utilities/ros_scripts.js
+++ b/client/app/utilities/ros_scripts.js
@@ -36,12 +36,14 @@ console.log('ros.connectionName = ' + ros.connectionName);
// If there is an error on the backend, an 'error' emit will be emitted.
ros.on('error', function(error) {
+ /*
document.getElementById("ConnectionIPForm").className = "form-group has-warning has-feedback";
document.getElementById("ConnectionIPInput").value = ros.connectionName;
document.getElementById("ConnectionIPLabel").innerHTML = 'No connection';
document.getElementById("ConnectionButton").className = "btn btn-warning"
document.getElementById("rosbridgeconnection_badge").innerHTML = 'No connection';
document.getElementById("ROSNodes").innerHTML = "No Nodes Detected";
+ */
rosbridgeconnection_badge
console.log(error);
@@ -50,11 +52,13 @@ ros.on('error', function(error) {
ros.on('connection', function() {
ros.connected = true;
console.log('Connection made!');
+ /*
document.getElementById("ConnectionIPForm").className = "form-group has-success has-feedback";
document.getElementById("ConnectionIPInput").value = ros.connectionName;
document.getElementById("ConnectionIPLabel").innerHTML = 'Connection made at:';
document.getElementById("rosbridgeconnection_badge").innerHTML = 'Connected';
document.getElementById("ConnectionButton").className = "btn btn-success";
+ */
ros.nodes = Array();
ros.topics = Array();
@@ -64,10 +68,14 @@ ros.on('connection', function() {
ros.on('close', function() {
console.log('Connection closed.');
ros.connected = false;
+
+ /*
document.getElementById("ConnectionIPForm").className = "form-group has-warning has-feedback";
document.getElementById("ConnectionIPLabel").innerHTML = 'Connection closed';
document.getElementById("ConnectionButton").className = "btn btn-warning"
document.getElementById("rosbridgeconnection_badge").innerHTML = 'Connection closed';
+ */
+
ros.nodes = Array();
ros.topics = Array();
});
diff --git a/client/include/fonts/Roboto-Black.ttf b/client/include/fonts/Roboto-Black.ttf
new file mode 100755
index 0000000..689fe5c
Binary files /dev/null and b/client/include/fonts/Roboto-Black.ttf differ
diff --git a/client/include/fonts/Roboto-BlackItalic.ttf b/client/include/fonts/Roboto-BlackItalic.ttf
new file mode 100755
index 0000000..0b4e0ee
Binary files /dev/null and b/client/include/fonts/Roboto-BlackItalic.ttf differ
diff --git a/client/include/fonts/Roboto-Bold.ttf b/client/include/fonts/Roboto-Bold.ttf
new file mode 100755
index 0000000..d3f01ad
Binary files /dev/null and b/client/include/fonts/Roboto-Bold.ttf differ
diff --git a/client/include/fonts/Roboto-BoldItalic.ttf b/client/include/fonts/Roboto-BoldItalic.ttf
new file mode 100755
index 0000000..41cc1e7
Binary files /dev/null and b/client/include/fonts/Roboto-BoldItalic.ttf differ
diff --git a/client/include/fonts/Roboto-Italic.ttf b/client/include/fonts/Roboto-Italic.ttf
new file mode 100755
index 0000000..6a1cee5
Binary files /dev/null and b/client/include/fonts/Roboto-Italic.ttf differ
diff --git a/client/include/fonts/Roboto-Light.ttf b/client/include/fonts/Roboto-Light.ttf
new file mode 100755
index 0000000..219063a
Binary files /dev/null and b/client/include/fonts/Roboto-Light.ttf differ
diff --git a/client/include/fonts/Roboto-LightItalic.ttf b/client/include/fonts/Roboto-LightItalic.ttf
new file mode 100755
index 0000000..0e81e87
Binary files /dev/null and b/client/include/fonts/Roboto-LightItalic.ttf differ
diff --git a/client/include/fonts/Roboto-Medium.ttf b/client/include/fonts/Roboto-Medium.ttf
new file mode 100755
index 0000000..1a7f3b0
Binary files /dev/null and b/client/include/fonts/Roboto-Medium.ttf differ
diff --git a/client/include/fonts/Roboto-MediumItalic.ttf b/client/include/fonts/Roboto-MediumItalic.ttf
new file mode 100755
index 0000000..0030295
Binary files /dev/null and b/client/include/fonts/Roboto-MediumItalic.ttf differ
diff --git a/client/include/fonts/Roboto-Regular.ttf b/client/include/fonts/Roboto-Regular.ttf
new file mode 100755
index 0000000..2c97eea
Binary files /dev/null and b/client/include/fonts/Roboto-Regular.ttf differ
diff --git a/client/include/fonts/Roboto-Thin.ttf b/client/include/fonts/Roboto-Thin.ttf
new file mode 100755
index 0000000..b74a4fd
Binary files /dev/null and b/client/include/fonts/Roboto-Thin.ttf differ
diff --git a/client/include/fonts/Roboto-ThinItalic.ttf b/client/include/fonts/Roboto-ThinItalic.ttf
new file mode 100755
index 0000000..dd0ddb8
Binary files /dev/null and b/client/include/fonts/Roboto-ThinItalic.ttf differ