Robotiq data subscription
This commit is contained in:
@@ -57,12 +57,26 @@
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Hardware Commands
|
||||
Robotiq
|
||||
</div>
|
||||
<div class="panel-body text-center">
|
||||
<button id="calibrateButton" type="button" onclick="triggerService('/aescape/hardware/calibrateRobotiq')" class="btn btn-primary">
|
||||
Calibrate Robotiq
|
||||
</button>
|
||||
<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('/aescape/hardware/calibrateRobotiq')" class="btn btn-primary">
|
||||
Calibrate Robotiq
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
|
||||
@@ -110,6 +110,28 @@ frankaStatus.subscribe(function(message) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Robotiq Data
|
||||
var robotiqDataTopic = new ROSLIB.Topic({
|
||||
ros : ros,
|
||||
name : '/robotiq_ft_wrench',
|
||||
messageType : 'geometry_msgs/WrenchStamped'
|
||||
});
|
||||
|
||||
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)
|
||||
|
||||
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"
|
||||
}
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Services
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user