Add list of ros bags
Add rosbag list
This commit is contained in:
@@ -164,26 +164,25 @@
|
|||||||
<span id="lastbagText">
|
<span id="lastbagText">
|
||||||
None
|
None
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div class="row-md-4">
|
||||||
<button type="button" onclick="triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-default">
|
<button type="button" onclick="triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-default">
|
||||||
Activate Ready Mode
|
Activate Ready Mode
|
||||||
</button>
|
</button>
|
||||||
<button id="executionLoadButton" type="button" onclick="triggerService('/aescape/bags/startPlayingLastRecording')" class="btn btn-primary">
|
<button id="executionLoadButton" type="button" onclick="triggerService('/aescape/bags/startPlayingLastRecording')" class="btn btn-primary">
|
||||||
Load Last Recording
|
Load Last Recording
|
||||||
</button>
|
</button>
|
||||||
<button id="executionStartButton" type="button" onclick="triggerService('/left/aescape/mode/activateExecutionController'); triggerTopic('/left/run_trajectory')" class="btn btn-primary">
|
<button id="executionStartButton" type="button" onclick="triggerService('/left/aescape/mode/activateExecutionController'); triggerTopic('/left/run_trajectory')" class="btn btn-primary">
|
||||||
Play Last Recording
|
Play Last Recording
|
||||||
</button>
|
</button>
|
||||||
<button id="executionStopButton" type="button" onclick="triggerService('/aescape/bags/stopPlayingBag'); triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-primary">
|
<button id="executionStopButton" type="button" onclick="triggerService('/aescape/bags/stopPlayingBag'); triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||||
Stop Playing Recording
|
Stop Playing Recording
|
||||||
</button>
|
</button>
|
||||||
<div class="row">
|
<div class="row-md-4">
|
||||||
<div class="col-md-3">
|
|
||||||
Bagfile name must not start with "/"
|
Bagfile name must not start with "/"
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" id="bagNameText" class="form-control" placeholder="bag_filename">
|
<input type="text" id="bagNameText" class="form-control" placeholder="bag_filename">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" onclick="triggerMessageService('/startPlayingRecording', 'bagNameText')">
|
<button class="btn btn-primary" type="button" onclick="triggerMessageService('/aescape/bags/startPlayingRecording', 'bagNameText')">
|
||||||
<span>
|
<span>
|
||||||
Start Playing Bag
|
Start Playing Bag
|
||||||
</span>
|
</span>
|
||||||
@@ -192,6 +191,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="row-md-4">
|
||||||
|
<<div class="col-md-3"> -->
|
||||||
|
<!-- Bagfile name must not start with "/"
|
||||||
|
<button class="btn btn-primary" type="button" onclick="updateRecordingsList()">
|
||||||
|
Refresh List
|
||||||
|
</button>
|
||||||
|
</div> -->
|
||||||
|
<div class="row-md-3 pt-4">
|
||||||
|
|
||||||
|
<div style="height:300px;width:300px;overflow:auto">
|
||||||
|
<div class="list-group" id="bagList">
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Dapibus ac facilisis in</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Morbi leo risus</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Porta ac consectetur ac</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
<button type="button" class="list-group-item list-group-item-action">Vestibulum at eros</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- </div> -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -302,3 +302,10 @@ function triggerMessageService(serviceName, textInput)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// function executeBagForm()
|
||||||
|
function updateSelectedBagFile(newFile)
|
||||||
|
{
|
||||||
|
// var newFile = document.getElementById(newFileInput).innerHTML
|
||||||
|
document.getElementById("bagNameText").value = newFile
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
var bagList = Array();
|
||||||
|
|
||||||
|
function getBagList()
|
||||||
|
{
|
||||||
|
var service = new ROSLIB.Service({
|
||||||
|
ros : ros,
|
||||||
|
name : '/aescape/bags/getBagList',
|
||||||
|
serviceType : 'demobot/TriggerList'
|
||||||
|
});
|
||||||
|
|
||||||
|
var request = new ROSLIB.ServiceRequest({});
|
||||||
|
|
||||||
|
service.callService(request, function(result) {
|
||||||
|
// console.log('Result for service call on '
|
||||||
|
// + serviceName
|
||||||
|
// + ': '
|
||||||
|
// + result.message);
|
||||||
|
|
||||||
|
bagList = result.message;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function updateRecordingsList()
|
||||||
|
{
|
||||||
|
getBagList();
|
||||||
|
|
||||||
|
if(bagList != null){
|
||||||
|
var innerHTML = "";
|
||||||
|
for (var i = 0; i < bagList.length; i++ )
|
||||||
|
{
|
||||||
|
// innerHTML = innerHTML.concat(bagList[i]);
|
||||||
|
// innerHTML = innerHTML.concat("<br>");
|
||||||
|
|
||||||
|
|
||||||
|
innerHTML += "<button type=\"button\" class=\"list-group-item list-group-item-action\" onclick=\"updateSelectedBagFile('" + bagList[i] + "')\">" + bagList[i] + "</button>";
|
||||||
|
// innerHTML += "<button type=\"button\" class=\"list-group-item list-group-item-action\" onclick=\"triggerMessageService('/aescape/bags/startPlayingRecording', '" + bagList[i] + "')\">" + bagList[i] + "</button>";
|
||||||
|
}
|
||||||
|
document.getElementById("bagList").innerHTML = innerHTML;
|
||||||
|
}
|
||||||
|
document.getElementById("bagNameText").value = message.data
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
window.setInterval(function(){
|
||||||
|
updateRecordingsList();
|
||||||
|
}, 1000);
|
||||||
Reference in New Issue
Block a user