longi cinematics
Cinématique de robot parallèle
HTML
<html>
<head>
<title>e-nugget cinematics</title>
</head>
<body>
<svg id="playground" height="800" width="500" xmlns="http://www.w3.org/2000/svg">
<line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" id="p1"/>
<line x1="200" y1="200" x2="0" y2="200" style="stroke:rgb(0,255,0);stroke-width:2" id="p2"/>
<line x1="0" y1="200" x2="200" y2="100" style="stroke:rgb(255,255,0);stroke-width:2" id="p3"/>
<line x1="200" y1="100" x2="0" y2="0" style="stroke:rgb(0,0,255);stroke-width:2" id="p4"/>
</svg>
<input type="range" id="Rtheta1" name="theta1" min="theta1min" max="theta1max">
<input type="range" id="Rtheta2" name="theta2" min="theta2min" max="theta2max">
<button onclick="sweep();">SWEEP!</button>
<label id="computeTime"></label>
<script type='text/javascript'>
var svgns = "http://www.w3.org/2000/svg";
// parametres :
// coordonées de l'origine (x vers la droite, y vers le bas)
var xA = 250;
var yA = 250;
// longueur des bielles
var L1 = 85;
var L2 = 130;
var L3 = 55;
var L4 = 122;
var L5 = 140;
// butees mecaniques
var theta1min = -90;
var theta1max = 0;
var theta2min = -15+90;
var theta2max = 55+90;
document.getElementById("Rtheta1").min = theta1min;
document.getElementById("Rtheta1").max = theta1max;
document.getElementById("Rtheta2").min = theta2min;
document.getElementById("Rtheta2").max = theta2max;
window.setInterval(function(){
var theta1 = document.getElementById("Rtheta1").value*Math.PI/180.0;
var theta2 = document.getElementById("Rtheta2").value*Math.PI/180.0;
[xA,yA,xB,yB,xC,yC,xD,yD,xF,yF] = MGD(theta1,theta2);
var p1 = document.getElementById("p1");
var p2 = document.getElementById("p2");
var p3 =...