Add robotiq force display
This commit is contained in:
@@ -186,6 +186,15 @@ robotiqDataTopic.subscribe(function(message) {
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user