12 Commits
ati ... develop

Author SHA1 Message Date
Matt DiCicco
1cf300f0c4 changed call to service rather than publisher for start playing 2019-07-18 14:49:56 -04:00
Matt DiCicco
9d05da0b48 fixes 2019-07-15 22:02:21 -04:00
Matt DiCicco
5abf44bb14 fixes 2019-07-15 21:04:47 -04:00
Rohit
6a464fd7b5 changed filename dependancy to id 2019-07-15 16:35:03 -04:00
Rohit
a3b61ce39b changed bag name to bag label 2019-07-15 15:02:44 -04:00
Rohit
0f297aa3fa added todo 2019-07-15 15:02:07 -04:00
Rohit
87b3e5d5c8 added body scaling complete button 2019-07-11 12:30:21 -04:00
Rohit
56c8423d7f Merge branch 'develop' of https://gitlab.com/aescape/lab_ui into v2 2019-07-10 14:23:43 -04:00
Matt DiCicco
a0629b9806 fix slider options buttons on tablet 2019-07-10 14:22:10 -04:00
Matt DiCicco
c292db1193 dumb ass bug 2019-07-10 14:18:59 -04:00
Matt DiCicco
d8645887a0 temp remove labels from bars to make progress bars work 2019-07-10 14:16:40 -04:00
Matt DiCicco
67c13ef2d7 fix 2019-07-08 19:16:27 -04:00
6 changed files with 62 additions and 59 deletions

View File

@@ -127,7 +127,7 @@
<div class="status-list">
<div class="commanded">
<div class="progress">
<div class="progress-bar-label">Commanded</div>
<!-- <div class="progress-bar-label">Commanded</div> -->
<div class="progress-bar bg-success" role="progressbar" id="frankaForceCommandedLeft" aria-valuenow="25" aria-valuemin="0" aria-valuemax="200">N/A</div>
</div>
<ul class="list-group list-group-horizontal text-center">
@@ -144,7 +144,7 @@
</div>
<div class="observed">
<div class="progress">
<div class="progress-bar-label">Observed</div>
<!-- <div class="progress-bar-label">Observed</div> -->
<div class="progress-bar bg-success" role="progressbar" id="frankaForceObservedLeft" aria-valuenow="25" aria-valuemin="0" aria-valuemax="200">
<span>N/A</span>
<div>
@@ -196,7 +196,7 @@
</div>
<div class="action-button panel-footer">
<button id="calibrateButton" type="button" onclick="triggerService('/left/aescape/hardware/calibrateATI')" class="btn">
<button id="calibrateButton" type="button" onclick="triggerService('/left/aescape/hardware/calibrateRobotiq')" class="btn">
Calibrate
</button>
</div>
@@ -351,13 +351,16 @@
</div>
<div class="panel-body text-center">
<div class="button-area">
<button id="executionLoadButton" type="button" onclick="displayLoadingOptions()" class="btn btn-primary col-md-4">
<button id="executionLoadButton" type="button" onclick="displayLoadingOptions()" class="btn btn-primary col-md-3">
Load Recording
</button>
<button id="executionStartButton" type="button" onclick="playLoadedRecording()" class="btn btn-primary col-md-4">
<button id="executionLoadButton" type="button" onclick="triggerService('/aescape/massageReady')" class="btn btn-primary col-md-3">
Complete Body Scaling
</button>
<button id="executionStartButton" type="button" onclick="playLoadedRecording()" class="btn btn-primary col-md-3">
Play Loaded Recording
</button>
<button id="executionStopButton" type="button" onclick="stopPlayingRecording()" class="btn btn-primary col-md-4">
<button id="executionStopButton" type="button" onclick="stopPlayingRecording()" class="btn btn-primary col-md-3">
Stop Playing Recording
</button>
</div>
@@ -545,7 +548,7 @@
<div class="status-list">
<div class="commanded">
<div class="progress">
<div class="progress-bar-label">Commanded</div>
<!-- <div class="progress-bar-label">Commanded</div> -->
<div class="progress-bar bg-success" role="progressbar" id="frankaForceCommandedRight" aria-valuenow="25" aria-valuemin="0" aria-valuemax="200">N/A</div>
</div>
<ul class="list-group list-group-horizontal text-center">
@@ -562,7 +565,7 @@
</div>
<div class="observed">
<div class="progress">
<div class="progress-bar-label">Observed</div>
<!-- <div class="progress-bar-label">Observed</div> -->
<div class="progress-bar bg-success" role="progressbar" id="frankaForceObservedRight" aria-valuenow="25" aria-valuemin="0" aria-valuemax="200">
<span>N/A</span>
<div>

View File

@@ -372,13 +372,16 @@ var playbackStatus = new ROSLIB.Topic({
playbackStatus.subscribe(function(message) {
message = JSON.parse(message.data);
console.log("message");
console.log(message);
status = message.status;
bagName = message.bag_file;
if (status != lastPlaybackStatus) {
if (true) {
if (status === "playing") {
} else if (status === "stopped") {
triggerService('/aescape/bags/stopPlayingBag');
triggerService('/left/aescape/mode/activateReadyController');
triggerService('/right/aescape/mode/activateReadyController');
displayTaggingOptions('play');
@@ -388,7 +391,6 @@ playbackStatus.subscribe(function(message) {
triggerService('/right/aescape/mode/activateReadyController');
displayMessage(true, "Loaded the selected bag file!")
}
lastPlaybackStatus = status;
}
});
@@ -577,7 +579,8 @@ function startTeachRecoding() {
async.waterfall([
function(callback) {
triggerService('/left/aescape/hardware/calibrateRobotiq', false, function(err, res){
callback(err, res);
//callback(err, res);
callback(null, null);
});
},
function(response, callback) {

View File

@@ -89,11 +89,9 @@ function displayTaggingOptions(mode) {
fileNameSelectize.clearOptions()
// /aescape/bags/getBagList
getBagList(function(results){
fileNameSelectize.addOption(results.map(function(element){
return {name : element.filename}
}));
fileNameSelectize.addOption(results)
if(results[0]) {
fileNameSelectize.setValue(results[0].filename);
fileNameSelectize.setValue(results[0]._id);
}
})
@@ -141,7 +139,7 @@ function hideTaggingOptions(mode, updateValues=false) {
}
var modeTag = '#' + mode + 'Tags';
var fileNameSelector = '#' + mode + 'BagFileName';
var bagLabelSelector = '#' + mode + 'BagFileName';
var categorySelector = '#' + mode + 'BagCategory';
var tagSelector = '#' + mode + 'BagTags';
var errorSelector = '#' + mode + 'TagError';
@@ -149,24 +147,23 @@ function hideTaggingOptions(mode, updateValues=false) {
if(updateValues) {
var filename = $(fileNameSelector).val();
var bagLabel = $(bagLabelSelector).val();
var category = $(categorySelector).val();
var tags = $(tagSelector).val();
var tags = $(tagSelector).val() || [];
getBagList(function(results){
if(!(results && results[0] && results[0].filename)) {
console.log(results);
if(!(results && results[0] && results[0]._id)) {
displayMessage(false, "Could not retrieve the last recorded bag :(");
return;
}
bag_name = results[0].filename;
updateBagMetadata(mode, bag_name, filename, category, tags, function(updateError) {
bag_id = results[0]._id;
updateBagMetadata(mode, bag_id, bagLabel, category, tags, function(updateError) {
if(updateError) {
displayMessage(flase, updateError);
} else {
displayMessage("Bag data saved successfully!");
//clear selectize
$(fileNameSelector).selectize()[0].selectize.destroy();
$(bagLabelSelector).selectize()[0].selectize.destroy();
$(categorySelector).selectize()[0].selectize.destroy();
$(tagSelector).selectize()[0].selectize.destroy();
}
@@ -178,18 +175,18 @@ function hideTaggingOptions(mode, updateValues=false) {
document.querySelector(modeTag).classList.remove('open');
}
function updateBagMetadata(mode, bag_name, modified_bag_name, category, tags, callback) {
function updateBagMetadata(mode, bag_id, bag_label, category, tags, callback) {
if(!mode) {
return callback();
}
if(!bag_name) {
if(!bag_id) {
return callback();
}
var toSend = {
mode : mode,
bag_name : bag_name,
modified_bag_name : modified_bag_name,
bag_id : bag_id,
bag_label : bag_label,
category : category,
tags : tags
}
@@ -214,32 +211,33 @@ function displayLoadingOptions() {
//Putting this in a timeout to wait for the animation to finish completing
setTimeout(function(){
document.querySelector(selector).style.overflow = "visible";
}, 420)
}, 420) //This is not a Hitchhiker's reference. This is not a 420 reference. This value has been computed to match the speed of the larger drop down.
var $select = $('#loadBagList').selectize({
valueField: 'filename',
labelField: 'filename',
searchField: ['filename', 'category', 'tags'],
valueField: '_id',
labelField: 'name',
searchField: ['name', 'category', 'tags'],
options: [],
create: false,
placeholder : "Select bag to play",
render : {
item: function(item, escape) {
filename = item.filename;
name = item.name;
category = item.category || 'None';
return '<div class="bag-select-element">' +
'<div class="bag-select-element">' +
'<span class="filename">' + escape(filename) + '</span>' +
'<span class="filename">' + escape(name) + '</span>' +
'<span class="category">' + ' (' + escape(category) + ') ' + '</span>' +
'</div>' +
'</div>';
},
option: function(item, escape) {
filename = item.filename;
name = item.name;
category = item.category || 'None';
return '<div class="bag-select-element bag-option">' +
'<div class="primary">' +
'<div class="filename">' + escape(filename) + '</div>' +
'<div class="filename">' + escape(name) + '</div>' +
'<div class="category">' + escape(category) + '</div>' +
'</div>' +
'<div class="secondary">' +
@@ -248,7 +246,7 @@ function displayLoadingOptions() {
return '<span class="tag label label-info">' + escape(tag) + '</span>'
}).join(' ') +
'</div>' +
'<div class="timestamp">' + escape('27 Jun 10:10am') + '</div>' +
'<div class="timestamp">' + escape(item.created_at) + '</div>' +
'</div>' +
'</div>';
}
@@ -263,6 +261,7 @@ function displayLoadingOptions() {
var selectize = $select[0].selectize;
selectize.clearOptions();
//results = [{filename : 'testfile', category: 'testcategory', tags : ['testtag1', 'testtag2', 'testtag3']}, {filename : 'testfile2', category: 'testcategory2', tags : ['testtag21', 'testtag22', 'testtag23']}]
console.log(results);
selectize.addOption(results);
if(results[0]) {
selectize.setValue(results[0].filename);
@@ -293,12 +292,10 @@ function hideLoadingOptions(loadBag) {
singleArmMode = false
}
console.log("singleArmMode");
console.log(singleArmMode)
if(loadBag) {
var selectedBagName = $('#loadBagList').val();
var selectedBagId = $('#loadBagList').val();
disableUI();
loadSelectedBagFile(selectedBagName, singleArmMode, function(updateError){
loadSelectedBagFile(selectedBagId, singleArmMode, function(updateError){
// if(updateError) {
// displayMessage(false, "Something went wrong in the backend while fetching the bag files :(")
// } else {
@@ -314,21 +311,22 @@ function hideLoadingOptions(loadBag) {
function loadSelectedBagFile(selectedBagName, singleArmMode, callback) {
function loadSelectedBagFile(selectedBagId, singleArmMode, callback) {
var toSend = {
bag_name : selectedBagName,
bag_id : selectedBagId,
single_arm : singleArmMode
}
// triggerService('/aescape/bags/startPlayingRecording', toSend, function(error, result) {
// if(!result) {
// return callback("Something went wrong in the backend while updating.");
// }
// else {
// return callback();
// }
// })
triggerService('/aescape/bags/startPlayingRecording', toSend, function(error, result) {
if(!result) {
return callback("Something went wrong in the backend while updating.");
}
else {
return callback();
}
})
/*
var toSendString = JSON.stringify(toSend);
var topic = new ROSLIB.Topic({
@@ -340,6 +338,7 @@ function loadSelectedBagFile(selectedBagName, singleArmMode, callback) {
var msg = new ROSLIB.Message({data:toSendString});
topic.publish(msg);
*/
}

View File

@@ -480,6 +480,11 @@ html, body {
background : #3671F9;
width: 100%;
margin-bottom: 10px;
height: 30px;
}
.slider-options .col-md-2 {
padding: 0px;
}
.progress-bar {

View File

@@ -66,15 +66,7 @@ function disableUI() {
}
document.querySelector('.dropdown').classList.add("disabled");
document.querySelectorAll('.force-bar .force-value span').forEach(function(element){
element.innerHTML = 0.0
});
document.querySelectorAll('.force-bar .progress-bar').forEach(function(element){
element.style.width = totalForcePercent + "%";
element.innerHTML = totalForce + " N";
element.setAttribute('aria-valuenow', totalForce);
});
} catch(err) {
console.log(err);

View File

@@ -38,6 +38,7 @@
}
</script>
<!-- TO DO: Use requirejs to reliably load these all the dependancies in order -->
<script>
$(function(){
$("#coordinatorContent").load("app/components/coordinator/coordinator.html");