Compare commits
17 Commits
feature/vi
...
release/0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec08e572fb | ||
|
|
03ccc8b2e3 | ||
|
|
5f1aaa0bbe | ||
|
|
88a10010f4 | ||
|
|
404fcf686e | ||
|
|
397f14a441 | ||
|
|
c52a5ba6bc | ||
|
|
f4f60e0188 | ||
|
|
baab18447d | ||
|
|
a6a0343154 | ||
|
|
365a4bb790 | ||
|
|
78bb28132f | ||
|
|
50186dd5e7 | ||
|
|
130edaa280 | ||
|
|
7bea1128df | ||
|
|
5a822a5927 | ||
|
|
e0fe291366 |
@@ -1,5 +1,12 @@
|
||||
# Aescape Lab UI
|
||||
|
||||
## To install
|
||||
```
|
||||
sudo apt install npm -y
|
||||
sudo npm install http-server -g
|
||||
sudo ln -s /usr/bin/nodejs /usr/bin/node
|
||||
```
|
||||
|
||||
## To run
|
||||
Set your master to be what you want - default is `phoebe`.
|
||||
Then run
|
||||
|
||||
@@ -7,8 +7,32 @@ 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';
|
||||
// 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) {
|
||||
@@ -20,7 +44,7 @@ ros.on('error', function(error) {
|
||||
document.getElementById("ROSNodes").innerHTML = "No Nodes Detected";
|
||||
|
||||
rosbridgeconnection_badge
|
||||
console.log(error);192
|
||||
console.log(error);
|
||||
});
|
||||
// Find out exactly when we made a connection.
|
||||
ros.on('connection', function() {
|
||||
@@ -119,6 +143,7 @@ bagNotifier.subscribe(function(message) {
|
||||
// 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;
|
||||
@@ -129,6 +154,7 @@ ros.attemptConnection = function(ipAddress)
|
||||
}
|
||||
console.log('Connection = ' + ros.connectionName);
|
||||
ros.connect(ros.connectionName);
|
||||
getMasterName();
|
||||
}
|
||||
|
||||
function toggleRecording()
|
||||
@@ -172,5 +198,8 @@ function getMasterName()
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ function updateNodesGUI()
|
||||
|
||||
};
|
||||
|
||||
window.setInterval(function(){
|
||||
// window.setInterval(function(){
|
||||
|
||||
updateTopicsGUI();
|
||||
updateNodesGUI();
|
||||
// updateTopicsGUI();
|
||||
// updateNodesGUI();
|
||||
|
||||
}, 5000);
|
||||
// }, 5000);
|
||||
|
||||
function validateForm()
|
||||
{
|
||||
|
||||
@@ -4,19 +4,40 @@
|
||||
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 class="col-md-6">
|
||||
<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="readyModeButton" type="button" onclick="triggerService('/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Ready 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 class="col-md-6">
|
||||
Safety Monitor Status:
|
||||
<div class="row-md-3">
|
||||
<h4><span id="safetyRunning" class="label label-default">Running</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<h4><span id="safetyStopped" class="label label-default">Stopped</span></h4>
|
||||
</div>
|
||||
<div class="row-md-3">
|
||||
<button type="button" onclick="triggerService('/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">
|
||||
@@ -84,10 +105,18 @@
|
||||
Teaching Mode Operations
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<button id="recordingStartButton" type="button" onclick="triggerService('/aescape/bags/startTeachRecording')" class="btn btn-primary">
|
||||
<span class="row">
|
||||
<label id="RecordingStatusLabel" class="label-warning">
|
||||
Bag manager not connected!
|
||||
</label>
|
||||
</span>
|
||||
<button type="button" onclick="triggerService('/aescape/mode/activateReadyController')" class="btn btn-default">
|
||||
Activate Ready Mode
|
||||
</button>
|
||||
<button id="recordingStartButton" type="button" onclick="triggerService('/aescape/hardware/calibrateRobotiq'); triggerService('/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')" class="btn btn-primary">
|
||||
<button id="recordingStopButton" type="button" onclick="triggerService('/aescape/bags/stopTeachRecording'); triggerService('/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Stop Teach Recording
|
||||
</button>
|
||||
</div>
|
||||
@@ -97,16 +126,28 @@
|
||||
<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="bagPlayingText">
|
||||
<span id="lastbagText">
|
||||
None
|
||||
</span>
|
||||
<div>
|
||||
<button id="executionStartButton" type="button" onclick="triggerService('/aescape/bags/startPlayingLastRecording')" class="btn btn-primary">
|
||||
<button type="button" onclick="triggerService('/aescape/mode/activateReadyController')" class="btn btn-default">
|
||||
Activate Ready Mode
|
||||
</button>
|
||||
<button id="executionStartButton" type="button" onclick="triggerService('/aescape/mode/activateExecutionController'); 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">
|
||||
<button id="executionStopButton" type="button" onclick="triggerService('/aescape/bags/stopPlayingBag'); triggerService('/aescape/mode/activateReadyController')" class="btn btn-primary">
|
||||
Stop Playing Recording
|
||||
</button>
|
||||
<div class="row">
|
||||
@@ -124,6 +165,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -27,33 +27,112 @@ var modeStatus = new ROSLIB.Topic({
|
||||
modeStatus.subscribe(function(message) {
|
||||
document.getElementById("stoppedModeButton").className = "btn btn-secondary"
|
||||
document.getElementById("standbyModeButton").className = "btn btn-primary"
|
||||
document.getElementById("readyModeButton").className = "btn btn-primary"
|
||||
document.getElementById("teachingModeButton").className = "btn btn-primary"
|
||||
document.getElementById("executionModeButton").className = "btn btn-primary"
|
||||
|
||||
document.getElementById("recordingStartButton").disabled = true
|
||||
document.getElementById("executionStartButton").disabled = true
|
||||
|
||||
|
||||
if (message.data == "stopped") {
|
||||
|
||||
if (message.data == "stopped")
|
||||
{
|
||||
document.getElementById("stoppedModeButton").className = "btn btn-warning"
|
||||
} else if (message.data == "standby")
|
||||
}
|
||||
else if (message.data == "standby")
|
||||
{
|
||||
document.getElementById("standbyModeButton").className = "btn btn-primary btn-success"
|
||||
} else if (message.data == "teach")
|
||||
}
|
||||
else if (message.data == "teach")
|
||||
{
|
||||
document.getElementById("teachingModeButton").className = "btn btn-primary btn-success"
|
||||
} else if (message.data == "execution")
|
||||
}
|
||||
else if (message.data == "execution")
|
||||
{
|
||||
document.getElementById("executionModeButton").className = "btn btn-primary btn-success"
|
||||
}
|
||||
else if (message.data == "ready")
|
||||
{
|
||||
document.getElementById("readyModeButton").className = "btn btn-primary btn-success"
|
||||
document.getElementById("recordingStartButton").disabled = false
|
||||
document.getElementById("executionStartButton").disabled = false
|
||||
}
|
||||
});
|
||||
|
||||
// Playing Bag
|
||||
// Safety Status
|
||||
var safetyStatusTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/aescape/mode/safety_status',
|
||||
messageType : 'std_msgs/String',
|
||||
throttle_rate : 500 // 2Hz
|
||||
});
|
||||
|
||||
safetyStatusTopic.subscribe(function(message) {
|
||||
document.getElementById("safetyRunning").className = 'label label-default';
|
||||
document.getElementById("safetyStopped").className = 'label label-default';
|
||||
|
||||
if (message.data == "stopped")
|
||||
{
|
||||
document.getElementById("safetyStopped").className = 'label label-danger';
|
||||
}
|
||||
else if (message.data == "running")
|
||||
{
|
||||
document.getElementById("safetyRunning").className = 'label label-success';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 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/playing',
|
||||
name : '/aescape/bags/last_played',
|
||||
messageType : 'std_msgs/String'
|
||||
});
|
||||
|
||||
bagPlayingTopic.subscribe(function(message) {
|
||||
document.getElementById("bagPlayingText").innerHTML = message.data
|
||||
document.getElementById("lastbagText").innerHTML = message.data
|
||||
});
|
||||
|
||||
// FrankaState
|
||||
|
||||
40
index.html
40
index.html
@@ -39,31 +39,21 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
|
||||
<script type="text/javascript" src="coordinator/js/update_guis.js"></script>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<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>
|
||||
<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>Lab UI</h1>
|
||||
<h1 id="Title">Lab UI</h1>
|
||||
|
||||
</div>
|
||||
<div class="container">
|
||||
@@ -91,7 +81,7 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#Vision" data-toggle="tab">
|
||||
<a href="vision/vision.html">
|
||||
Vision
|
||||
</a>
|
||||
</li>
|
||||
@@ -103,9 +93,9 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
|
||||
<div class="tab-pane active" id="Coordinator">
|
||||
<div id="coordinatorContent"></div>
|
||||
</div>
|
||||
<div class="tab-pane" id="Vision">
|
||||
<!-- <div class="tab-pane" id="Vision">
|
||||
<div id="visionContent"></div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="tab-pane" id="rosbridgeconnection">
|
||||
@@ -143,26 +133,26 @@ Tutorials can be found here: http://www.w3schools.com/bootstrap/default.asp
|
||||
Predefined ROSBridge Connections
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<!-- <button id="localhostButton" type="button" onclick="ros.attemptConnection('ws://localhost:9090')" class="btn btn-primary">
|
||||
<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="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="TitanButton" type="button" onclick="ros.attemptConnection('ws://titan.aescape.co:9090')" class="btn btn-primary">
|
||||
titan.aescape.co
|
||||
<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>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<launch>
|
||||
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch" />
|
||||
|
||||
<node name="lab_ui_web_server" pkg="aescape_lab_ui" type="webserver.sh" respawn="true" />
|
||||
<node name="lab_ui_web_server" pkg="aescape_lab_ui" type="webserver.sh" respawn="false" />
|
||||
|
||||
<node name="lab_ui_video_server" pkg="web_video_server" type="web_video_server" respawn="true" >
|
||||
<param name="address" value="titan.aescape.co" />
|
||||
</node>
|
||||
<node name="lab_ui_video_server" pkg="web_video_server" type="web_video_server" respawn="false" />
|
||||
|
||||
</launch>
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
<run_depend>rospy</run_depend>
|
||||
<run_depend>std_msgs</run_depend>
|
||||
|
||||
<run_depend>web_video_server</run_depend>
|
||||
<run_depend>rosbridge_server</run_depend>
|
||||
|
||||
<!-- The export tag contains other, unspecified, tags -->
|
||||
<export>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd $(rospack find aescape_lab_ui)
|
||||
python3 -m http.server 8000 --bind titan.aescape.co
|
||||
# python3 -m http.server 8000
|
||||
|
||||
# Node webserver: https://www.npmjs.com/package/http-server
|
||||
http-server -p 8000
|
||||
@@ -80,6 +80,9 @@
|
||||
|
||||
</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
|
||||
@@ -97,31 +100,13 @@
|
||||
<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">
|
||||
Bodyscaling
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-lg-4">
|
||||
<button id="stoppedModeButton" type="button" onclick="triggerService('/aescape/mode/stopControllers')" class="btn btn-primary">
|
||||
Stopped Mode
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
Realsense Red - Capture
|
||||
<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 - Capture
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Execution Recording Operations
|
||||
|
||||
Reference in New Issue
Block a user