-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.html
96 lines (73 loc) · 2.28 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="scripts/mustache.js"></script>
<script type="text/javascript" src="scripts/math.min.js"></script>
<script type="text/javascript" src="scripts/vkbeautify.js"></script>
<script type="text/javascript" src="./dh-converter.js"></script>
<style>
#drop_zone {
border: 2px dashed #bbb;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding: 25px;
text-align: center;
font: 20pt bold 'Vollkorn';
color: #bbb;
}
#drop_zone:hover
{
border-color:green;
border-style: dotted;
}
.gcode
{
font-family:"Courier New",monospace;
width:100%;
height:50%;
}
.gcode_drop
{
height:10%;
}
}</style>
</head>
<body>
<h3>Denavit Hartenberg to URDF converter</h3>
<p> You can use <a href="www.mymodelrobot.appspot.com">MyModelRobot</a> to view your URDF files online</p>
<form>
<div id="drop_zone"><b>Insert your DH-table here </b>: <br><textarea class="gcode gcode_drop" id="dh-table" rows="8">
|th|d|a|alpha|R|
-------
|0|0|0|0|true|
|0|2|0|pi/2|false|
|0|0|2|0|true|
|0|0|2|0|true|
|-0.8|0|1|0|true|</textarea></div>
<output id="list"></output>
<div id="file_text"></div>
<button type="button" id="convert_button">Convert DH</button>
<textarea id="wynik_urdf" rows="15" class="gcode">Result</textarea>
</form>
<p> Some important info:
Use <b>radians</b> when defining angle values. Program does some basic calculations, such as pi/2 becomes 1.571. </br>
You can have additional offsets in rotational or prismatic joints by having theta or d values. If there are no offsets,
the column with variable (i.e. theta or d) should be 0.</p>
<p> Last column should be set true if the joint is rotational and false if it is prismatic </p>
<p>
Code availible at: <a href="https://github.com/AdoHaha/DH2URDF">https://github.com/AdoHaha/DH2URDF</a> </p>
</body>
</html>
<script type="text/javascript">
var dropZone = document.getElementById('dh-table');
var buttonz = document.getElementById('convert_button');
function konwertuj(event)
{
event.preventDefault();
tab_dh=document.getElementById('dh-table').value;
robot=new Robot_Maker(tab_dh).urdf;
document.getElementById('wynik_urdf').value = robot;
}
buttonz.addEventListener("click", konwertuj,false);
</script>