created client folder and moved files there
This commit is contained in:
BIN
client/backend/images/D-pad.png
Normal file
BIN
client/backend/images/D-pad.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
BIN
client/backend/images/D-pad_blank.png
Normal file
BIN
client/backend/images/D-pad_blank.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 600 B |
BIN
client/backend/images/D-pad_center.png
Normal file
BIN
client/backend/images/D-pad_center.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
BIN
client/backend/images/D-pad_left.png
Normal file
BIN
client/backend/images/D-pad_left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
client/backend/images/D-pad_up.png
Normal file
BIN
client/backend/images/D-pad_up.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
3
client/backend/js/Node.js
Normal file
3
client/backend/js/Node.js
Normal file
@@ -0,0 +1,3 @@
|
||||
function Node (name) {
|
||||
this.name = name;
|
||||
}
|
||||
12
client/backend/js/Topic.js
Normal file
12
client/backend/js/Topic.js
Normal file
@@ -0,0 +1,12 @@
|
||||
function Topic (name) {
|
||||
this.name = name;
|
||||
this.bag = true;
|
||||
this.type = "";
|
||||
}
|
||||
|
||||
Array.prototype.indexOfTopic = function(name) {
|
||||
for (var i = 0; i < this.length; i++)
|
||||
if (this[i].name == name)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
205
client/backend/js/ros_scripts.js
Normal file
205
client/backend/js/ros_scripts.js
Normal file
@@ -0,0 +1,205 @@
|
||||
var ros = new ROSLIB.Ros();
|
||||
|
||||
|
||||
ros.topics = Array();
|
||||
ros.nodes = Array();
|
||||
ros.recording = false;
|
||||
ros.connected = false;
|
||||
|
||||
// ros.connectionName = 'ws://192.168.1.105:9090';
|
||||
|
||||
function getQueryVariable(variable)
|
||||
{
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split("&");
|
||||
for (var i=0;i<vars.length;i++) {
|
||||
var pair = vars[i].split("=");
|
||||
if(pair[0] == variable){
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var master = "localhost"
|
||||
master = getQueryVariable("master")
|
||||
if(master == null)
|
||||
{
|
||||
master = window.location.hostname
|
||||
//"localhost"
|
||||
}
|
||||
console.log('Master = ' + master);
|
||||
|
||||
ros.connectionName = 'ws://' + master + ':9090';
|
||||
// ros.connectionName = 'ws://localhost:9090';
|
||||
// ros.connectionName = 'ws://titan.aescape.co:9090';
|
||||
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);
|
||||
});
|
||||
// Find out exactly when we made a connection.
|
||||
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();
|
||||
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
// Create a connection to the rosbridge WebSocket server.
|
||||
//ros.connect(ros.connectionName);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Publishers
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function publishBagMessage(bagFilename)
|
||||
{
|
||||
var bag_file_message = ""
|
||||
bag_file_message += bagFilename;
|
||||
if (bagFilename != "STOP")
|
||||
{
|
||||
for (topic in ros.topics)
|
||||
{
|
||||
if(ros.topics[topic].bag)
|
||||
{
|
||||
bag_file_message += " " + ros.topics[topic].name
|
||||
}
|
||||
}
|
||||
}
|
||||
var bagMessage = new ROSLIB.Message({
|
||||
data : bagFilename
|
||||
})
|
||||
bagPublisher.publish(bagMessage)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Topics
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
var bagPublisher = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : 'bag_publisher',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
var bagNotifier = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : 'bag_notifier',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Subscribers
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
bagNotifier.subscribe(function(message) {
|
||||
if (message.data === "STARTED") {
|
||||
document.getElementById("recordButtonText").innerHTML = "Stop"
|
||||
document.getElementById("recordButton").className = "btn btn-danger"
|
||||
} else if (message.data === "STOPPED")
|
||||
{
|
||||
document.getElementById("recordButtonText").innerHTML = "Start"
|
||||
document.getElementById("recordButton").className = "btn btn-primary"
|
||||
}
|
||||
|
||||
console.log("bagNotifier: " +message.data)
|
||||
});
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Functions
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// attept to connect to the ros master from the IP given orgrab it from the form
|
||||
ros.attemptConnection = function(ipAddress)
|
||||
{
|
||||
ros.close();
|
||||
if( typeof ipAddress !== "undefined")
|
||||
{
|
||||
ros.connectionName = ipAddress;
|
||||
}
|
||||
else
|
||||
{
|
||||
ros.connectionName = document.getElementById("ConnectionIPInput").value
|
||||
}
|
||||
console.log('Connection = ' + ros.connectionName);
|
||||
ros.connect(ros.connectionName);
|
||||
getMasterName();
|
||||
}
|
||||
|
||||
function toggleRecording()
|
||||
{
|
||||
if(ros.connected)
|
||||
{
|
||||
document.getElementById("recordButtonText").innerHTML = "Wait"
|
||||
document.getElementById("recordButton").className = "btn btn-warning"
|
||||
|
||||
if (!ros.recording) {
|
||||
ros.recording = true
|
||||
topicstobag = " "
|
||||
for (i = 0; i < ros.topics.length; i ++)
|
||||
{
|
||||
if (ros.topics[i].bag == true)
|
||||
{
|
||||
topicstobag = topicstobag.concat(ros.topics[i].name + " ")
|
||||
}
|
||||
}
|
||||
publishBagMessage(document.getElementById("recordText").value + topicstobag)
|
||||
} else {
|
||||
ros.recording = false
|
||||
publishBagMessage("STOP")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getMasterName()
|
||||
{
|
||||
var service = new ROSLIB.Service({
|
||||
ros : ros,
|
||||
name : '/rosapi/service_host',
|
||||
serviceType : 'rosapi/ServiceHost'
|
||||
});
|
||||
|
||||
var request = new ROSLIB.ServiceRequest({
|
||||
service: '/rosout/get_loggers' // Only the master hosts this service.
|
||||
});
|
||||
|
||||
service.callService(request, function(result) {
|
||||
console.log('Master Name = ' + result.host);
|
||||
document.getElementById("MasterName").innerHTML = result.host;
|
||||
var title = result.host + " Lab UI"
|
||||
document.title = title;
|
||||
document.getElementById("Title").innerHTML = title;
|
||||
});
|
||||
}
|
||||
101
client/backend/js/update_guis.js
Normal file
101
client/backend/js/update_guis.js
Normal file
@@ -0,0 +1,101 @@
|
||||
|
||||
|
||||
function updateTopicsGUI()
|
||||
{
|
||||
|
||||
ros.getTopics(function(result)
|
||||
{
|
||||
ros.topics = result;
|
||||
});
|
||||
|
||||
var topics = ros.topics;
|
||||
|
||||
if(topics != null){
|
||||
var innerHTML = "";
|
||||
for (var i = 0; i < topics.length; i++ )
|
||||
{
|
||||
innerHTML = innerHTML.concat(topics[i]);
|
||||
innerHTML = innerHTML.concat("<br>");
|
||||
}
|
||||
document.getElementById("ROSTopics").innerHTML = innerHTML;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
function updateNodesGUI()
|
||||
{
|
||||
|
||||
ros.getNodes(function(result)
|
||||
{
|
||||
ros.nodes = result;
|
||||
});
|
||||
|
||||
var nodes = ros.nodes;
|
||||
|
||||
nodes.sort()
|
||||
|
||||
if(nodes != null){
|
||||
var innerHTML = "";
|
||||
for (var i = 0; i < nodes.length; i++ )
|
||||
{
|
||||
innerHTML = innerHTML.concat(nodes[i]);
|
||||
innerHTML = innerHTML.concat("<br>");
|
||||
}
|
||||
document.getElementById("ROSNodes").innerHTML = innerHTML;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// window.setInterval(function(){
|
||||
|
||||
// updateTopicsGUI();
|
||||
// updateNodesGUI();
|
||||
|
||||
// }, 5000);
|
||||
|
||||
function validateForm()
|
||||
{
|
||||
ros.attemptConnection();
|
||||
return false;
|
||||
};
|
||||
|
||||
function addInputsForConnection()
|
||||
{
|
||||
|
||||
var innerHTML = "";
|
||||
|
||||
for (var i = 0; i < ros.connectioninfo.length; i ++)
|
||||
{
|
||||
|
||||
console.log(ros.connectioninfo[i])
|
||||
el = document.getElementById("ConnectionInformation")
|
||||
|
||||
innerHTML = innerHTML.concat("<span class=\"col-sm-1\">");
|
||||
innerHTML = innerHTML.concat("<input type=\"text\" class=\"form-control\" value=\"");
|
||||
innerHTML = innerHTML.concat(ros.connectioninfo[i])
|
||||
innerHTML = innerHTML.concat("\"/>")
|
||||
innerHTML = innerHTML.concat("</span>")
|
||||
if(i >0 && i < 4)
|
||||
{
|
||||
innerHTML = innerHTML.concat("<span class=\"col-sxm-1\">.</span>")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
el.innerHTML = innerHTML;
|
||||
|
||||
console.log(innerHTML)
|
||||
|
||||
|
||||
}
|
||||
|
||||
function mylog(input)
|
||||
{
|
||||
console.log(input)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
361
client/coordinator/coordinator.html
Normal file
361
client/coordinator/coordinator.html
Normal file
@@ -0,0 +1,361 @@
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body text-center">
|
||||
<div class="col-lg-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Left Arm Controls
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
EEF Configuration
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
You must be in "Stopped Mode" to change the EEF configuration!
|
||||
<button type="button" onclick="triggerService('/left/aescape/hardware/setTrainingEEF')" class="btn btn-primary">
|
||||
Recording EEF
|
||||
</button>
|
||||
<button type="button" onclick="triggerService('/left/aescape/hardware/setExecutionEEF')" class="btn btn-primary">
|
||||
Massage EEF
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Select Operation Mode
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="col-md-6">
|
||||
<button id="left_teachingModeButton" type="button" onclick="triggerService('/left/aescape/mode/activateTeachingController')" class="btn btn-primary">
|
||||
Teaching Mode
|
||||
</button>
|
||||
<button id="left_executionModeButton" type="button" onclick="triggerService('/left/aescape/mode/activateExecutionController')" class="btn btn-primary">
|
||||
Massage Mode
|
||||
</button>
|
||||
<button id="left_readyModeButton" type="button" onclick="triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Ready Mode
|
||||
</button>
|
||||
<button id="left_standbyModeButton" type="button" onclick="triggerService('/left/aescape/mode/activateStandbyController')" class="btn btn-primary">
|
||||
Standby Mode
|
||||
</button>
|
||||
<button id="left_stoppedModeButton" type="button" onclick="triggerService('/left/aescape/mode/stopControllers')" class="btn btn-primary">
|
||||
Stopped Mode
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
Safety Monitor Status:
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_safetyRunning" class="label label-default">Running</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_safetyStopped" class="label label-default">Stopped</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<button type="button" onclick="triggerService('/left/aescape/mode/activateSafetyController')" class="btn btn-sm btn-default">
|
||||
Activate Safety Monitor
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Franka Arm Status
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="col-md-4">
|
||||
Current Robot Status:
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_frankaModeOther" class="label label-default">Other</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_frankaModeIdle" class="label label-default">Idle</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_frankaModeMove" class="label label-default">Move</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_frankaModeGuiding" class="label label-default">Guiding</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_frankaModeReflex" class="label label-default">Reflex</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_frankaModeUserStopped" class="label label-default">User Stopped</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="left_frankaModeErrorRecovery" class="label label-default">Automatic Error Recovery</span></h4>
|
||||
</div>
|
||||
</div>
|
||||
<button id="left_fixFrankaButton" type="button" onclick="triggerService('/left/aescape/hardware/resetFrankaError')" class="btn btn-primary">
|
||||
Fix Franka Errors
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Robotiq
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="row-md-3">
|
||||
<div class="progress" id="robotiqForce">
|
||||
<div class="progress-bar bg-success" role="progressbar" id="robotiqForceBar" aria-valuenow="25" aria-valuemin="0" aria-valuemax="200">N/A</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
Current Robotiq Values:
|
||||
<div class="row-md-3">
|
||||
<h4>X: <span id="robotiqX" class="label label-default">0.0</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4>Y: <span id="robotiqY" class="label label-default">0.0</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4>Z: <span id="robotiqZ" class="label label-default">0.0</span></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<button id="calibrateButton" type="button" onclick="triggerService('/left/aescape/hardware/calibrateRobotiq')" class="btn btn-primary">
|
||||
Calibrate Robotiq
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Teaching Mode Operations
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<span class="row">
|
||||
<label id="RecordingStatusLabel" class="label-warning">
|
||||
Bag manager not connected!
|
||||
</label>
|
||||
</span>
|
||||
<button type="button" onclick="triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-default">
|
||||
Activate Ready Mode
|
||||
</button>
|
||||
<button id="recordingStartButton" type="button" onclick="triggerService('/left/aescape/hardware/calibrateRobotiq'); triggerService('/left/aescape/mode/activateTeachingController'); triggerService('/aescape/bags/startTeachRecording')" class="btn btn-primary">
|
||||
Start Teach Recording
|
||||
</button>
|
||||
<button id="recordingStopButton" type="button" onclick="triggerService('/aescape/bags/stopTeachRecording'); triggerService('/left/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Stop Teach Recording
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Execution Mode Operations
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel-body text-center">
|
||||
|
||||
<span class="row">
|
||||
<label id="ExecutionStatusLabel" class="label-warning">
|
||||
Bag manager not connected!
|
||||
</label>
|
||||
</span>
|
||||
|
||||
Last Bag Playing:
|
||||
<span id="lastbagText">
|
||||
None
|
||||
</span>
|
||||
<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('/aescape/bags/startPlayingRecording', 'bagNameText')">
|
||||
<span>
|
||||
Start Playing Bag
|
||||
</span>
|
||||
</button>
|
||||
</span>
|
||||
</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 class="col-lg-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Right Arm Controls
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
EEF Configuration
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
You must be in "Stopped Mode" to change the EEF configuration!
|
||||
<button type="button" onclick="triggerService('/right/aescape/hardware/setTrainingEEF')" class="btn btn-primary">
|
||||
Recording EEF
|
||||
</button>
|
||||
<button type="button" onclick="triggerService('/right/aescape/hardware/setExecutionEEF')" class="btn btn-primary">
|
||||
Massage EEF
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Select Operation Mode
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="col-md-6">
|
||||
<button id="right_teachingModeButton" type="button" onclick="triggerService('/right/aescape/mode/activateTeachingController')" class="btn btn-primary">
|
||||
Teaching Mode
|
||||
</button>
|
||||
<button id="right_executionModeButton" type="button" onclick="triggerService('/right/aescape/mode/activateExecutionController')" class="btn btn-primary">
|
||||
Massage Mode
|
||||
</button>
|
||||
<button id="right_readyModeButton" type="button" onclick="triggerService('/right/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Ready Mode
|
||||
</button>
|
||||
<button id="right_standbyModeButton" type="button" onclick="triggerService('/right/aescape/mode/activateStandbyController')" class="btn btn-primary">
|
||||
Standby Mode
|
||||
</button>
|
||||
<button id="right_stoppedModeButton" type="button" onclick="triggerService('/right/aescape/mode/stopControllers')" class="btn btn-primary">
|
||||
Stopped Mode
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
Safety Monitor Status:
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_safetyRunning" class="label label-default">Running</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_safetyStopped" class="label label-default">Stopped</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<button type="button" onclick="triggerService('/right/aescape/mode/activateSafetyController')" class="btn btn-sm btn-default">
|
||||
Activate Safety Monitor
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Franka Arm Status
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="col-md-4">
|
||||
Current Robot Status:
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_frankaModeOther" class="label label-default">Other</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_frankaModeIdle" class="label label-default">Idle</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_frankaModeMove" class="label label-default">Move</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_frankaModeGuiding" class="label label-default">Guiding</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_frankaModeReflex" class="label label-default">Reflex</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_frankaModeUserStopped" class="label label-default">User Stopped</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="right_frankaModeErrorRecovery" class="label label-default">Automatic Error Recovery</span></h4>
|
||||
</div>
|
||||
</div>
|
||||
<button id="right_fixFrankaButton" type="button" onclick="triggerService('/right/aescape/hardware/resetFrankaError')" class="btn btn-primary">
|
||||
Fix Franka Errors
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Robotiq
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="col-md-4">
|
||||
Current Robotiq Values:
|
||||
<div class="row-md-3">
|
||||
<h4>X: <span id="robotiqX" class="label label-default">0.0</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4>Y: <span id="robotiqY" class="label label-default">0.0</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4>Z: <span id="robotiqZ" class="label label-default">0.0</span></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<button id="calibrateButton" type="button" onclick="triggerService('/right/aescape/hardware/calibrateRobotiq')" class="btn btn-primary">
|
||||
Calibrate Robotiq
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Execution Recording Operations
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<button id="executionStartButton" type="button" onclick="triggerService('/startExecutionRecording')" class="btn btn-primary">
|
||||
Start Recording Execution
|
||||
</button>
|
||||
<button id="executionRecordingStopButton" type="button" onclick="triggerService('/stopExecutionRecording')" class="btn btn-primary">
|
||||
Stop Recording Execution
|
||||
</button>
|
||||
</div>
|
||||
</div> -->
|
||||
311
client/coordinator/js/ros_scripts.js
Normal file
311
client/coordinator/js/ros_scripts.js
Normal file
@@ -0,0 +1,311 @@
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Publishers
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function triggerTopic(topicName)
|
||||
{
|
||||
var topic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : topicName,
|
||||
messageType : 'std_msgs/Empty'
|
||||
});
|
||||
|
||||
var msg = new ROSLIB.Message({});
|
||||
|
||||
topic.publish(msg);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Topics
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Subscribers
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
class ArmControls
|
||||
{
|
||||
constructor(namespace) {
|
||||
this.namespace = namespace;
|
||||
|
||||
// Franka Status
|
||||
this.frankaStatusTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/'+this.namespace+'/franka_state_controller/franka_states',
|
||||
messageType : 'franka_msgs/FrankaState',
|
||||
throttle_rate : 500 // 2Hz
|
||||
});
|
||||
this.frankaStatusTopic.subscribe(this.frankaStatus.bind(this));
|
||||
|
||||
// Mode Status
|
||||
this.modeStatusTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/'+this.namespace+'/aescape/mode/status',
|
||||
messageType : 'std_msgs/String',
|
||||
throttle_rate : 500 // 2Hz
|
||||
});
|
||||
this.modeStatusTopic.subscribe(this.modeStatus.bind(this));
|
||||
|
||||
// Safety Status
|
||||
this.safetyStatusTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/'+this.namespace+'/aescape/mode/safety_status',
|
||||
messageType : 'std_msgs/String',
|
||||
throttle_rate : 500 // 2Hz
|
||||
});
|
||||
this.safetyStatusTopic.subscribe(this.safetyStatus.bind(this));
|
||||
|
||||
}
|
||||
|
||||
// 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"
|
||||
}
|
||||
else if (message.robot_mode == 4)
|
||||
{
|
||||
document.getElementById(this.namespace+"_frankaModeReflex").className = "label label-warning"
|
||||
document.getElementById(this.namespace+"_fixFrankaButton").className = "btn btn-danger"
|
||||
|
||||
}
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
||||
// 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"
|
||||
|
||||
if (this.namespace == "left")
|
||||
{
|
||||
document.getElementById("recordingStartButton").disabled = true
|
||||
document.getElementById("executionStartButton").disabled = true
|
||||
}
|
||||
|
||||
if (message.data == "stopped")
|
||||
{
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 leftArmControls = new ArmControls('left');
|
||||
var rightArmControls = new ArmControls('right');
|
||||
|
||||
|
||||
// Robotiq Data
|
||||
var robotiqDataTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/left/robotiq_ft_wrench',
|
||||
messageType : 'geometry_msgs/WrenchStamped',
|
||||
throttle_rate : 500 // 2Hz
|
||||
});
|
||||
|
||||
robotiqDataTopic.subscribe(function(message) {
|
||||
var force = message.wrench.force
|
||||
document.getElementById("robotiqX").innerHTML = force.x.toFixed(1)
|
||||
document.getElementById("robotiqY").innerHTML = force.y.toFixed(1)
|
||||
document.getElementById("robotiqZ").innerHTML = force.z.toFixed(1)
|
||||
|
||||
var totalForce = math.norm([force.x, force.y, force.z]).toFixed(1)
|
||||
var totalForcePercent = totalForce/2
|
||||
|
||||
doc = document.getElementById("robotiqForceBar");
|
||||
doc.style.width = totalForcePercent + "%";
|
||||
doc.innerHTML = totalForce + " N";
|
||||
doc.setAttribute('aria-valuenow', totalForce);
|
||||
|
||||
|
||||
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"
|
||||
} else {
|
||||
document.getElementById("calibrateButton").className = "btn btn-default"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Recording Bag
|
||||
var recordingBagTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/aescape/bags/recording_status',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
recordingBagTopic.subscribe(function(message) {
|
||||
if (message.data == "stopped")
|
||||
{
|
||||
document.getElementById("RecordingStatusLabel").innerHTML = 'Not Running';
|
||||
document.getElementById("RecordingStatusLabel").className = 'label label-warning';
|
||||
}
|
||||
else if (message.data == "running")
|
||||
{
|
||||
document.getElementById("RecordingStatusLabel").innerHTML = 'RUNNING!';
|
||||
document.getElementById("RecordingStatusLabel").className = 'label label-success';
|
||||
}
|
||||
});
|
||||
|
||||
// Executing Bag
|
||||
var executingBagTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/aescape/bags/execution_status',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
executingBagTopic.subscribe(function(message) {
|
||||
if (message.data == "stopped")
|
||||
{
|
||||
document.getElementById("ExecutionStatusLabel").innerHTML = 'Not Running';
|
||||
document.getElementById("ExecutionStatusLabel").className = 'label label-warning';
|
||||
}
|
||||
else if (message.data == "running")
|
||||
{
|
||||
document.getElementById("ExecutionStatusLabel").innerHTML = 'RUNNING!';
|
||||
document.getElementById("ExecutionStatusLabel").className = 'label label-success';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Last Bag
|
||||
var bagPlayingTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/aescape/bags/last_played',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
bagPlayingTopic.subscribe(function(message) {
|
||||
document.getElementById("lastbagText").innerHTML = message.data
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Services
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
function triggerService(serviceName)
|
||||
{
|
||||
var service = new ROSLIB.Service({
|
||||
ros : ros,
|
||||
name : serviceName,
|
||||
serviceType : 'std_srvs/Trigger'
|
||||
});
|
||||
|
||||
var request = new ROSLIB.ServiceRequest({});
|
||||
|
||||
service.callService(request, function(result) {
|
||||
console.log('Result for service call on '
|
||||
+ serviceName
|
||||
+ ': '
|
||||
+ result.sum);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function triggerMessageService(serviceName, textInput)
|
||||
{
|
||||
var text = document.getElementById(textInput).value
|
||||
|
||||
var service = new ROSLIB.Service({
|
||||
ros : ros,
|
||||
name : serviceName,
|
||||
serviceType : 'demobot.TriggerMessage'
|
||||
});
|
||||
|
||||
var request = new ROSLIB.ServiceRequest({
|
||||
message : text
|
||||
});
|
||||
|
||||
service.callService(request, function(result) {
|
||||
console.log('Result for service call on '
|
||||
+ serviceName
|
||||
+ ': '
|
||||
+ result.sum);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// function executeBagForm()
|
||||
function updateSelectedBagFile(newFile)
|
||||
{
|
||||
// var newFile = document.getElementById(newFileInput).innerHTML
|
||||
document.getElementById("bagNameText").value = newFile
|
||||
}
|
||||
47
client/coordinator/js/update_guis.js
Normal file
47
client/coordinator/js/update_guis.js
Normal file
@@ -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);
|
||||
5
client/include/css/bootstrap.min.css
vendored
Normal file
5
client/include/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
client/include/js/bootstrap.min.js
vendored
Normal file
7
client/include/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
client/include/js/eventemitter2.min.js
vendored
Normal file
1
client/include/js/eventemitter2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
client/include/js/jquery.min.js
vendored
Normal file
4
client/include/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
56
client/include/js/math.min.js
vendored
Normal file
56
client/include/js/math.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4742
client/include/js/roslib.js
Normal file
4742
client/include/js/roslib.js
Normal file
File diff suppressed because it is too large
Load Diff
2
client/include/js/roslib.min.js
vendored
Normal file
2
client/include/js/roslib.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
192
client/index.html
Normal file
192
client/index.html
Normal file
@@ -0,0 +1,192 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Lab UI</title>
|
||||
|
||||
<link rel="stylesheet" href="include/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<script type="text/javascript" src="include/js/eventemitter2.min.js"></script>
|
||||
|
||||
<script src="include/js/jquery.min.js"></script>
|
||||
<script src="include/js/bootstrap.min.js"></script>
|
||||
<script src="include/js/math.min.js"></script>
|
||||
|
||||
<script src="include/js/roslib.js"></script>
|
||||
<script type="text/javascript" src="include/js/roslib.js"></script>
|
||||
|
||||
<script type="text/javascript" src="backend/js/ros_scripts.js"></script>
|
||||
<script type="text/javascript" src="backend/js/update_guis.js"></script>
|
||||
|
||||
<script type="text/javascript" src="backend/js/Topic.js"></script>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#coordinatorContent").load("coordinator/coordinator.html");
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="coordinator/js/ros_scripts.js"></script>
|
||||
<script type="text/javascript" src="coordinator/js/update_guis.js"></script>
|
||||
|
||||
|
||||
<!-- <script>
|
||||
$(function(){
|
||||
$("#visionContent").load("vision/vision.html");
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="vision/js/ros_scripts.js"></script>
|
||||
<script type="text/javascript" src="vision/js/update_guis.js"></script> -->
|
||||
|
||||
<meta content="text/html; charset=UTF-8; X-Content-Type-Options=nosniff" http-equiv="Content-Type" />
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div id="jumbotronTitle" class="jumbotron text-center">
|
||||
<h1 id="Title">Lab UI</h1>
|
||||
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="col-md-1">
|
||||
Master:
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label id="MasterName"></label>
|
||||
<script>
|
||||
getMasterName();
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<ul id="tabs" class="nav nav-pills" data-tabs="tabs" >
|
||||
<li> <a href="#rosbridgeconnection" data-toggle="tab">
|
||||
ROS Bridge Connection
|
||||
<span id="rosbridgeconnection_badge" class="badge">
|
||||
Not Connected
|
||||
</span></a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="#Coordinator" data-toggle="tab">
|
||||
Coordinator
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="vision/vision.html">
|
||||
Vision
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="my-tab-content" class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="Coordinator">
|
||||
<div id="coordinatorContent"></div>
|
||||
</div>
|
||||
<!-- <div class="tab-pane" id="Vision">
|
||||
<div id="visionContent"></div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="tab-pane" id="rosbridgeconnection">
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-inline" role="form" onsubmit="return validateForm()">
|
||||
<div id="ConnectionIPForm" class="form-group has-warning" align="center">
|
||||
<span>
|
||||
<label id="ConnectionIPLabel" class="control-label" for="inputWarning">
|
||||
Connection Warning
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<div class="input-group">
|
||||
<input type="text" id="ConnectionIPInput" class="form-control" placeholder="ROS Bridge Master IP" placeholder="No IP Address yet">
|
||||
<span class="input-group-btn">
|
||||
<button id="ConnectionButton" type="button" onclick="ros.attemptConnection()" class="btn btn-warning">
|
||||
Connect
|
||||
<script type="text/javascript">
|
||||
document.getElementById("ConnectionIPInput").value = ros.connectionName;
|
||||
</script>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Predefined ROSBridge Connections
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<button id="localhostButton" type="button" onclick="ros.attemptConnection('ws://localhost:9090')" class="btn btn-primary">
|
||||
localhost
|
||||
<script type="text/javascript">
|
||||
document.getElementById("ConnectionIPInput").value = ros.connectionName;
|
||||
</script>
|
||||
</button>
|
||||
<button id="TitanButton" type="button" onclick="ros.attemptConnection('ws://titan.local:9090')" class="btn btn-primary">
|
||||
Titan
|
||||
<script type="text/javascript">
|
||||
document.getElementById("ConnectionIPInput").value = ros.connectionName;
|
||||
</script>
|
||||
</button>
|
||||
<button id="PhoebeButton" type="button" onclick="ros.attemptConnection('ws://phoebe.local:9090')" class="btn btn-primary">
|
||||
Phoebe
|
||||
<script type="text/javascript">
|
||||
document.getElementById("ConnectionIPInput").value = ros.connectionName;
|
||||
</script>
|
||||
</button>
|
||||
<button id="RheaButton" type="button" onclick="ros.attemptConnection('ws://rhea.local:9090')" class="btn btn-primary">
|
||||
Rhea
|
||||
<script type="text/javascript">
|
||||
document.getElementById("ConnectionIPInput").value = ros.connectionName;
|
||||
</script>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Create a connection to the rosbridge WebSocket server.
|
||||
ros.connect(ros.connectionName);
|
||||
</script>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
ROS Topics.
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="col-sm-1" id="ROSTopics">
|
||||
N/A
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
ROS Nodes.
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="col-sm-1" id="ROSNodes">
|
||||
N/A
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
104
client/vision/js/ros_scripts.js
Normal file
104
client/vision/js/ros_scripts.js
Normal file
@@ -0,0 +1,104 @@
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Publishers
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Topics
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Subscribers
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
// Operation Mode
|
||||
var modeStatus = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/aescape/mode/status',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
modeStatus.subscribe(function(message) {
|
||||
document.getElementById("stoppedModeButton").className = "btn btn-secondary"
|
||||
document.getElementById("standbyModeButton").className = "btn btn-primary"
|
||||
document.getElementById("teachingModeButton").className = "btn btn-primary"
|
||||
document.getElementById("executionModeButton").className = "btn btn-primary"
|
||||
|
||||
|
||||
if (message.data === "stopped") {
|
||||
document.getElementById("stoppedModeButton").className = "btn btn-warning"
|
||||
} else if (message.data === "standby")
|
||||
{
|
||||
document.getElementById("standbyModeButton").className = "btn btn-primary btn-success"
|
||||
} else if (message.data === "teach")
|
||||
{
|
||||
document.getElementById("teachingModeButton").className = "btn btn-primary btn-success"
|
||||
} else if (message.data === "execution")
|
||||
{
|
||||
document.getElementById("executionModeButton").className = "btn btn-primary btn-success"
|
||||
}
|
||||
});
|
||||
|
||||
// Playing Bag
|
||||
var bagPlayingTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/aescape/bags/playing',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
bagPlayingTopic.subscribe(function(message) {
|
||||
document.getElementById("bagPlayingText").innerHTML = message.data
|
||||
});
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Services
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
function triggerService(serviceName)
|
||||
{
|
||||
var service = new ROSLIB.Service({
|
||||
ros : ros,
|
||||
name : serviceName,
|
||||
serviceType : 'std_srvs/Trigger'
|
||||
});
|
||||
|
||||
var request = new ROSLIB.ServiceRequest({});
|
||||
|
||||
service.callService(request, function(result) {
|
||||
console.log('Result for service call on '
|
||||
+ serviceName
|
||||
+ ': '
|
||||
+ result.sum);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function triggerMessageService(serviceName, textInput)
|
||||
{
|
||||
var text = document.getElementById(textInput).value
|
||||
|
||||
var service = new ROSLIB.Service({
|
||||
ros : ros,
|
||||
name : serviceName,
|
||||
serviceType : 'demobot.TriggerMessage'
|
||||
});
|
||||
|
||||
var request = new ROSLIB.ServiceRequest({
|
||||
message : text
|
||||
});
|
||||
|
||||
service.callService(request, function(result) {
|
||||
console.log('Result for service call on '
|
||||
+ serviceName
|
||||
+ ': '
|
||||
+ result.sum);
|
||||
});
|
||||
}
|
||||
0
client/vision/js/update_guis.js
Normal file
0
client/vision/js/update_guis.js
Normal file
122
client/vision/vision.html
Normal file
122
client/vision/vision.html
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
<!-- <div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Select Operation Mode
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<button id="teachingModeButton" type="button" onclick="triggerService('/aescape/mode/activateTeachingController')" class="btn btn-primary">
|
||||
Teaching Mode
|
||||
</button>
|
||||
<button id="executionModeButton" type="button" onclick="triggerService('/aescape/mode/activateExecutionController')" class="btn btn-primary">
|
||||
Massage Mode
|
||||
</button>
|
||||
<button id="standbyModeButton" type="button" onclick="triggerService('/aescape/mode/activateStandbyController')" class="btn btn-primary">
|
||||
Standby Mode
|
||||
</button>
|
||||
<button id="stoppedModeButton" type="button" onclick="triggerService('/aescape/mode/stopControllers')" class="btn btn-primary">
|
||||
Stopped Mode
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Hardware Commands
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<button id="fixFrankaButton" type="button" onclick="triggerService('/aescape/hardware/resetFrankaError')" class="btn btn-primary">
|
||||
Fix Franka Errors
|
||||
</button>
|
||||
<button id="calibrateButton" type="button" onclick="triggerService('/aescape/hardware/calibrateRobotiq')" class="btn btn-primary">
|
||||
Calibrate Robotiq
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Teaching Mode Operations
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<button id="recordingStartButton" type="button" onclick="triggerService('/aescape/bags/startTeachRecording')" class="btn btn-primary">
|
||||
Start Teach Recording
|
||||
</button>
|
||||
<button id="recordingStopButton" type="button" onclick="triggerService('/aescape/bags/stopTeachRecording')" class="btn btn-primary">
|
||||
Stop Teach Recording
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Execution Mode Operations
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
Last Bag Playing:
|
||||
<span id="bagPlayingText">
|
||||
None
|
||||
</span>
|
||||
<div>
|
||||
<button id="executionStartButton" type="button" onclick="triggerService('/aescape/bags/startPlayingLastRecording')" class="btn btn-primary">
|
||||
Play Last Recording
|
||||
</button>
|
||||
<button id="executionStopButton" type="button" onclick="triggerService('/aescape/bags/stopPlayingBag')" class="btn btn-primary">
|
||||
Stop Playing Recording
|
||||
</button>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
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')">
|
||||
<span>
|
||||
Start Playing Bag
|
||||
</span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
<script type="text/javascript" src="vision/js/ros_scripts.js"></script>
|
||||
<script type="text/javascript" src="vision/js/update_guis.js"></script>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Camera Views
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
Webcam
|
||||
<div class="row-lg-4">
|
||||
<img height="350" alt="No Camera Image" id="imageStream" src="http://titan.aescape.co:8080/stream?topic=/webcam/image_raw&type=ros_compressed"></img>
|
||||
</div>
|
||||
Realsense Red
|
||||
<div class="row-lg-4">
|
||||
<img height="350" alt="No Camera Image" id="imageStream" src="http://titan.aescape.co:8080/stream?topic=/real_red/color/image_raw&type=ros_compressed"></img>
|
||||
</div>
|
||||
Realsense Green
|
||||
<div class="row-lg-4">
|
||||
<img height="350" alt="No Camera Image" id="imageStream" src="http://titan.aescape.co:8080/stream?topic=/real_green/color/image_raw&type=ros_compressed"></img>
|
||||
</div>
|
||||
Thermal
|
||||
<div class="row-lg-4">
|
||||
<img height="350" alt="No Camera Image" id="imageStream" src="http://titan.aescape.co:8080/stream?topic=/thermal/image_raw&type=ros_compressed"></img>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Execution Recording Operations
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<button id="executionStartButton" type="button" onclick="triggerService('/startExecutionRecording')" class="btn btn-primary">
|
||||
Start Recording Execution
|
||||
</button>
|
||||
<button id="executionRecordingStopButton" type="button" onclick="triggerService('/stopExecutionRecording')" class="btn btn-primary">
|
||||
Stop Recording Execution
|
||||
</button>
|
||||
</div>
|
||||
</div> -->
|
||||
Reference in New Issue
Block a user