Add list of ros bags
Add rosbag list
This commit is contained in:
@@ -164,26 +164,25 @@
|
||||
<span id="lastbagText">
|
||||
None
|
||||
</span>
|
||||
<div>
|
||||
<button type="button" onclick="triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-default">
|
||||
Activate Ready Mode
|
||||
</button>
|
||||
<button id="executionLoadButton" type="button" onclick="triggerService('/aescape/bags/startPlayingLastRecording')" class="btn btn-primary">
|
||||
Load Last Recording
|
||||
</button>
|
||||
<button id="executionStartButton" type="button" onclick="triggerService('/left/aescape/mode/activateExecutionController'); triggerTopic('/left/run_trajectory')" class="btn btn-primary">
|
||||
Play Last Recording
|
||||
</button>
|
||||
<button id="executionStopButton" type="button" onclick="triggerService('/aescape/bags/stopPlayingBag'); triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Stop Playing Recording
|
||||
</button>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="row-md-4">
|
||||
<button type="button" onclick="triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-default">
|
||||
Activate Ready Mode
|
||||
</button>
|
||||
<button id="executionLoadButton" type="button" onclick="triggerService('/aescape/bags/startPlayingLastRecording')" class="btn btn-primary">
|
||||
Load Last Recording
|
||||
</button>
|
||||
<button id="executionStartButton" type="button" onclick="triggerService('/left/aescape/mode/activateExecutionController'); triggerTopic('/left/run_trajectory')" class="btn btn-primary">
|
||||
Play Last Recording
|
||||
</button>
|
||||
<button id="executionStopButton" type="button" onclick="triggerService('/aescape/bags/stopPlayingBag'); triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Stop Playing Recording
|
||||
</button>
|
||||
<div class="row-md-4">
|
||||
Bagfile name must not start with "/"
|
||||
<div class="input-group">
|
||||
<input type="text" id="bagNameText" class="form-control" placeholder="bag_filename">
|
||||
<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>
|
||||
Start Playing Bag
|
||||
</span>
|
||||
@@ -192,6 +191,32 @@
|
||||
</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>
|
||||
|
||||
@@ -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