Operation Mode
-
+
diff --git a/client/app/components/coordinator/js/ros_scripts.js b/client/app/components/coordinator/js/ros_scripts.js
index f96ef80..db0539d 100644
--- a/client/app/components/coordinator/js/ros_scripts.js
+++ b/client/app/components/coordinator/js/ros_scripts.js
@@ -404,105 +404,15 @@ function triggerService(serviceName, toSend)
}, 1000);
}
-
-function triggerMessageService(serviceName, text)
-{
- var service = new ROSLIB.Service({
- ros : ros,
- name : serviceName,
- serviceType : 'demobot.TriggerMessage'
- });
-
- var request = new ROSLIB.ServiceRequest({
- message : text
- });
-
- var serviceCallTimeStamp = Date.now();
- var serviceCallReturned = false;
-
- service.callService(request, function(result) {
- console.log('Result for service call on '
- + serviceName
- + ': '
- + result);
- //check for result.success == false
- if(result.success == true) {
- $(document).ready(function(){
- $.notify({
- message: "Going good! "+ serviceName
- }, {
- "placement" : {
- from: "bottom",
- align: "right"
- },
- type: 'success',
- delay: 1000
- });
- });
- } else {
- $(document).ready(function(){
- $.notify({
- message: "Something went wrong :( " + serviceName
- }, {
- "placement" : {
- from: "bottom",
- align: "right"
- },
- type: 'danger',
- delay: 1000
- });
- });
- }
- serviceCallReturned = true;
-
- }, function(error){
- console.log("errored");
- $(document).ready(function(){
- $.notify({
- message: "Something went wrong :( " + serviceName
- }, {
- "placement" : {
- from: "bottom",
- align: "right"
- },
- type: 'danger',
- delay: 1000
- });
- });
- serviceCallReturned = true;
- });
- var responseCheckInterval = setInterval(function() {
- var timeElapsedSinceServiceCall = Date.now() - serviceCallTimeStamp; // milliseconds elapsed since start
- if(serviceCallReturned) {
- clearInterval(responseCheckInterval);
- return;
- } else if (timeElapsedSinceServiceCall > 3000){
- $(document).ready(function(){
- $.notify({
- message: "Timeout on " + serviceName
- }, {
- "placement" : {
- from: "bottom",
- align: "right"
- },
- type: 'danger',
- delay: 1000
- });
- });
- clearInterval(responseCheckInterval);
- return;
- }
- }, 1000);
-}
-
-
-
function loadSelectedBagFile() {
var selectedBagName = $('#bagList').val();
- triggerMessageService('/aescape/bags/startPlayingRecording', selectedBagName)
-}
+ var toSend = {
+ message : selectedBagName
+ }
+ triggerService('/aescape/bags/startPlayingRecording', toSend)
+}
@@ -517,3 +427,37 @@ function invokeSafetyController(event)
}
+
+function displayTaggingOptions(id) {
+
+ //populate the values in the select boxes on every display
+ // /aescape/bags/getCategoryList
+ // /aescape/bags/getTagList
+ // /aescape/bags/getBagList
+
+
+ //Subscribe to topics from the backend which indicate recording or playback is complete
+ document.getElementById(id).style.display = '';
+}
+
+function hideTaggingOptions(id, updateValues=false) {
+ if(updateValues) {
+ //get values from the elements
+ updateBagMetadata(mode, bag_name, modified_bag_name, category, tags)
+ }
+ //TO DO: Wait for the response from the backend before setting the display to none
+ document.getElementById(id).style.display = 'none'
+}
+
+function updateBagMetadata(mode, bag_name, modified_bag_name, category, tags) {
+ if(!mode) {
+ return //error
+ }
+ if(!bag_name) {
+ return // error
+ }
+ triggerService('/aescape/bags/updateBagMeta')
+}
+
+
+
diff --git a/client/app/main.css b/client/app/main.css
index 1100f02..132fad1 100644
--- a/client/app/main.css
+++ b/client/app/main.css
@@ -370,7 +370,16 @@ html, body {
.popover {
color: black;
+ width: 500px;
}
+ .tagging-options {
+ display: flex;
+ align-items: center;
+ }
+
+ .tagging-options select{
+ width: 100%;
+ }
\ No newline at end of file