Skip to content

Commit dbf65e6

Browse files
committed
Added serveral Model files
DHFactor in progress (commented out)
1 parent f9b0a64 commit dbf65e6

File tree

13 files changed

+94113
-0
lines changed

13 files changed

+94113
-0
lines changed

roboticstoolbox/DHFactor.py

Lines changed: 940 additions & 0 deletions
Large diffs are not rendered by default.

roboticstoolbox/models/Ball.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox.robot.serial_link import *
7+
from roboticstoolbox.robot.Link import RevoluteDH
8+
from math import pi
9+
import numpy as np
10+
11+
12+
class Ball(SerialLink):
13+
14+
# %MDL_BALL Create model of a ball manipulator
15+
# %
16+
# % MDL_BALL creates the workspace variable ball which describes the
17+
# % kinematic characteristics of a serial link manipulator with 50 joints
18+
# % that folds into a ball shape.
19+
# %
20+
# % MDL_BALL(N) as above but creates a manipulator with N joints.
21+
# %
22+
# % Also define the workspace vectors:
23+
# % q joint angle vector for default ball configuration
24+
# %
25+
# % Reference::
26+
# % - "A divide and conquer articulated-body algorithm for parallel O(log(n))
27+
# % calculation of rigid body dynamics, Part 2",
28+
# % Int. J. Robotics Research, 18(9), pp 876-892.
29+
# %
30+
# % Notes::
31+
# % - Unlike most other mdl_xxx scripts this one is actually a function that
32+
# % behaves like a script and writes to the global workspace.
33+
# %
34+
# % See also mdl_coil, SerialLink.
35+
#
36+
# % MODEL: generic, ball shape, hyper redundant, 50DOF, standard_DH
37+
#
38+
#
39+
# % Copyright (C) 1993-2017, by Peter I. Corke
40+
# %
41+
# % This file is part of The Robotics Toolbox for MATLAB (RTB).
42+
# %
43+
# % RTB is free software: you can redistribute it and/or modify
44+
# % it under the terms of the GNU Lesser General Public License as published by
45+
# % the Free Software Foundation, either version 3 of the License, or
46+
# % (at your option) any later version.
47+
# %
48+
# % RTB is distributed in the hope that it will be useful,
49+
# % but WITHOUT ANY WARRANTY; without even the implied warranty of
50+
# % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+
# % GNU Lesser General Public License for more details.
52+
# %
53+
# % You should have received a copy of the GNU Leser General Public License
54+
# % along with RTB. If not, see <http://www.gnu.org/licenses/>.
55+
# %
56+
# % http://www.petercorke.com
57+
def __init__(self, N=None):
58+
59+
links = []
60+
self._qz = []
61+
if not N:
62+
N = 10
63+
self.N = N
64+
65+
for i in range(self.N):
66+
links.append(Link(a=0.1, alpha=pi/2))
67+
self._qz.append(self.fract(i+1))
68+
69+
# and build a serial link manipulator
70+
super(Ball, self).__init__(links, name='ball')
71+
72+
@property
73+
def qz(self):
74+
return self._qz
75+
76+
def fract(self, i):
77+
theta1 = 1
78+
theta2 = -2/3
79+
80+
out = i % 3
81+
if out < 1:
82+
f = self.fract(i/3)
83+
elif out < 2:
84+
f = theta1
85+
else:
86+
f = theta2
87+
return f

roboticstoolbox/models/Baxter.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox.robot.serial_link import *
7+
from roboticstoolbox.robot.Link import RevoluteDH
8+
from math import pi
9+
import spatialmath.base as tr
10+
import numpy as np
11+
12+
# %MDL_BAXTER Kinematic model of Baxter dual-arm robot
13+
# %
14+
# % MDL_BAXTER is a script that creates the workspace variables left and
15+
# % right which describes the kinematic characteristics of the two 7-joint
16+
# % arms of a Rethink Robotics Baxter robot using standard DH conventions.
17+
# %
18+
# % Also define the workspace vectors:
19+
# % qz zero joint angle configuration
20+
# % qr vertical 'READY' configuration
21+
# % qd lower arm horizontal as per data sheet
22+
# %
23+
# % Notes::
24+
# % - SI units of metres are used.
25+
# %
26+
# % References::
27+
# % "Kinematics Modeling and Experimental Verification of Baxter Robot"
28+
# % Z. Ju, C. Yang, H. Ma, Chinese Control Conf, 2015.
29+
# %
30+
# % See also mdl_nao, SerialLink.
31+
#
32+
# % Copyright (C) 1993-2017, by Peter I. Corke
33+
# %
34+
# % This file is part of The Robotics Toolbox for MATLAB (RTB).
35+
# %
36+
# % RTB is free software: you can redistribute it and/or modify
37+
# % it under the terms of the GNU Lesser General Public License as published by
38+
# % the Free Software Foundation, either version 3 of the License, or
39+
# % (at your option) any later version.
40+
# %
41+
# % RTB is distributed in the hope that it will be useful,
42+
# % but WITHOUT ANY WARRANTY; without even the implied warranty of
43+
# % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44+
# % GNU Lesser General Public License for more details.
45+
# %
46+
# % You should have received a copy of the GNU Leser General Public License
47+
# % along with RTB. If not, see <http://www.gnu.org/licenses/>.
48+
# %
49+
# % http://www.petercorke.com
50+
#
51+
#
52+
# % MODEL: Baxter, Rethink Robotics, 7DOF, standard_DH
53+
54+
L = [RevoluteDH(d=0.27, a=0.069, alpha=-pi/2),
55+
RevoluteDH(d=0, a=0, alpha=pi/2, offset=pi/2),
56+
RevoluteDH(d=0.102+0.262, a=0.069, alpha=-pi/2),
57+
RevoluteDH(d=0,a=0, alpha=pi/2),
58+
RevoluteDH(d=0.103+0.271,a=0.010, alpha=-pi/2),
59+
RevoluteDH(d=0,a=0, alpha=pi/2),
60+
RevoluteDH(d=0.28,a=0, alpha=0)]
61+
62+
left = SerialLink(L, name='Baxter Left')
63+
Right = SerialLink(L, name='Baxter Right')
64+
65+
# % define the workspace vectors:
66+
# % qz zero joint angle configuration
67+
# % qr vertical 'READY' configuration
68+
# % qstretch arm is stretched out in the X direction
69+
# % qn arm is at a nominal non-singular configuration
70+
71+
qz = [0, 0, 0, 0, 0, 0, 0] # zero angles, L shaped pose
72+
qr = [0, -pi/2, -pi/2, 0, 0, 0, 0] # ready pose, arm up
73+
qs = [0, 0, -pi/2, 0, 0, 0, 0]
74+
qn = [0, pi/4, pi/2, 0, pi/4, 0, 0]

roboticstoolbox/models/Cobra600.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox.robot.serial_link import *
7+
from roboticstoolbox.robot.Link import RevoluteDH
8+
from math import pi
9+
import numpy as np
10+
11+
12+
class Cobra600(SerialLink):
13+
14+
# %MDL_COBRA600 Create model of Adept Cobra 600 manipulator
15+
# %
16+
# % MDL_COBRA600 is a script that creates the workspace variable c600 which
17+
# % describes the kinematic characteristics of the 4-axis Adept Cobra 600
18+
# % SCARA manipulator using standard DH conventions.
19+
# %
20+
# % Also define the workspace vectors:
21+
# % qz zero joint angle configuration
22+
# %
23+
# % Notes::
24+
# % - SI units are used.
25+
# %
26+
# % See also SerialRevolute, mdl_puma560akb, mdl_stanford.
27+
#
28+
# % Copyright (C) 1993-2017, by Peter I. Corke
29+
# %
30+
# % This file is part of The Robotics Toolbox for MATLAB (RTB).
31+
# %
32+
# % RTB is free software: you can redistribute it and/or modify
33+
# % it under the terms of the GNU Lesser General Public License as published by
34+
# % the Free Software Foundation, either version 3 of the License, or
35+
# % (at your option) any later version.
36+
# %
37+
# % RTB is distributed in the hope that it will be useful,
38+
# % but WITHOUT ANY WARRANTY; without even the implied warranty of
39+
# % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40+
# % GNU Lesser General Public License for more details.
41+
# %
42+
# % You should have received a copy of the GNU Leser General Public License
43+
# % along with RTB. If not, see <http://www.gnu.org/licenses/>.
44+
# %
45+
# % http://www.petercorke.com
46+
#
47+
# % MODEL: Adept, Cobra600, 4DOF, standard_DH
48+
#
49+
# % hardstop limits included
50+
def __init__(self):
51+
deg = pi/180
52+
53+
L = [RevoluteDH(d=0.387, a=0.325, qlim=[-50*deg, 50*deg]),
54+
RevoluteDH(a=0.275, alpha=pi, qlim=[-88*deg, 88*deg]),
55+
PrismaticDH(qlim=[0, 0.210]),
56+
RevoluteDH()]
57+
58+
super(Cobra600, self).__init__(L, name='Cobra600', manufacturer='Adept')
59+
60+
self._qz = [0, 0, 0, 0]
61+
62+
@property
63+
def qz(self):
64+
return self._qz

roboticstoolbox/models/Fanuc10L.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox.robot.serial_link import *
7+
from roboticstoolbox.robot.Link import RevoluteDH
8+
from math import pi
9+
import numpy as np
10+
11+
12+
# %MDL_FANUC10L Create kinematic model of Fanuc AM120iB/10L robot
13+
# %
14+
# % MDL_FANUC10L is a script that creates the workspace variable R which
15+
# % describes the kinematic characteristics of a Fanuc AM120iB/10L robot
16+
# % using standard DH conventions.
17+
# %
18+
# % Also defines the workspace vector:
19+
# % q0 mastering position.
20+
# %
21+
# % Notes::
22+
# % - SI units of metres are used.
23+
# %
24+
# % Author::
25+
# % Wynand Swart,
26+
# % Mega Robots CC, P/O Box 8412, Pretoria, 0001, South Africa,
27+
# % wynand.swart@gmail.com
28+
# %
29+
# % See also mdl_irb140, mdl_m16, mdl_motomanHP6, mdl_puma560, SerialLink.
30+
#
31+
# % MODEL: Fanuc, AM120iB/10L, 6DOF, standard_DH
32+
#
33+
# % Copyright (C) 1993-2011, by Peter I. Corke
34+
# %
35+
# % This file is part of The Robotics Toolbox for Matlab (RTB).
36+
# %
37+
# % RTB is free software: you can redistribute it and/or modify
38+
# % it under the terms of the GNU Lesser General Public License as published by
39+
# % the Free Software Foundation, either version 3 of the License, or
40+
# % (at your option) any later version.
41+
# %
42+
# % RTB is distributed in the hope that it will be useful,
43+
# % but WITHOUT ANY WARRANTY; without even the implied warranty of
44+
# % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45+
# % GNU Lesser General Public License for more details.
46+
# %
47+
# % You should have received a copy of the GNU Leser General Public License
48+
# % along with RTB. If not, see <http://www.gnu.org/licenses/>.
49+
#
50+
# %Cell: 073-1555-430
51+
# %30 Sep 2007
52+
# %Fanuc AM120iB/10L robot
53+
L1 = Link(a=0.15, alpha=-pi/2)
54+
L2 = Link(a=0.77, alpha=pi)
55+
L3 = Link(a=0.1, alpha=-pi/2)
56+
L4 = Link(d=-0.96, alpha=pi/2)
57+
L5 = Link(a=0, alpha=-pi/2)
58+
L6 = Link(d=-0.1)
59+
L = [L1, L2, L3, L4, L5, L6]
60+
61+
q0 = [0, -pi/2, 0, 0, 0, 0]
62+
63+
R = SerialLink(L, 'name', 'Fanuc AM120iB/10L')

roboticstoolbox/models/KR5.py

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox.robot.serial_link import *
7+
from roboticstoolbox.robot.Link import RevoluteDH
8+
from math import pi
9+
import numpy as np
10+
11+
12+
class KR5(SerialLink):
13+
14+
# %MDL_KR5 Create model of Kuka KR5 manipulator
15+
# %
16+
# % MDL_KR5 is a script that creates the workspace variable KR5 which
17+
# % describes the kinematic characteristics of a Kuka KR5 manipulator using
18+
# % standard DH conventions.
19+
# %
20+
# % Also define the workspace vectors:
21+
# % qk1 nominal working position 1
22+
# % qk2 nominal working position 2
23+
# % qk3 nominal working position 3
24+
# %
25+
# % Notes::
26+
# % - SI units of metres are used.
27+
# % - Includes an 11.5cm tool in the z-direction
28+
# %
29+
# % Author::
30+
# % - Gautam Sinha,
31+
# % Indian Institute of Technology, Kanpur.
32+
# %
33+
# % See also mdl_irb140, mdl_fanuc10l, mdl_motomanHP6, mdl_S4ABB2p8, mdl_puma560, SerialLink.
34+
#
35+
# % MODEL: Kuka, KR5, 6DOF, standard_DH
36+
#
37+
# %mdl_KR5
38+
# %Define simplest line model for KUKA KR5 robot
39+
# %Contain DH parameters for KUKA KR5 robot
40+
# %All link lenghts and offsets are measured in cm
41+
def __init__(self):
42+
deg = pi/180
43+
44+
L1 = RevoluteDH(a=0.18, d=0.4,
45+
alpha=pi/2,
46+
mesh='KUKA/KR5_arc/link1.stl')
47+
L2 = RevoluteDH(a=0.6, d=0.135,
48+
alpha=pi,
49+
mesh='KUKA/KR5_arc/link2.stl')
50+
L3 = RevoluteDH(a=0.12,
51+
d=0.135,
52+
alpha=-pi/2,
53+
mesh='KUKA/KR5_arc/link3.stl')
54+
L4 = RevoluteDH(a=0.0,
55+
d=0.62,
56+
alpha=pi/2,
57+
mesh='KUKA/KR5_arc/link4.stl')
58+
L5 = RevoluteDH(a=0.0,
59+
d=0.0,
60+
alpha=-pi/2,
61+
mesh='KUKA/KR5_arc/link5.stl')
62+
L6 = RevoluteDH(mesh='KUKA/KR5_arc/link6.stl')
63+
64+
L = [L1, L2, L3, L4, L5, L6]
65+
66+
self._qz = [0, 0, 0, 0, 0, 0]
67+
68+
self._qk1 = [pi/4, pi/3, pi/4, pi/6, pi/4, pi/6]
69+
70+
self._qk2 = [pi/4, pi/3, pi/6, pi/3, pi/4, pi/6]
71+
72+
self._qk3 = [pi/6, pi/3, pi/6, pi/3, pi/6, pi/3]
73+
74+
# Create SerialLink object
75+
super(KR5, self).__init__(
76+
L,
77+
basemesh="KUKA/KR5_arc/link0.stl",
78+
name='KR5',
79+
manufacturer='KUKA')
80+
81+
@property
82+
def qz(self):
83+
return self._qz
84+
85+
@property
86+
def qk1(self):
87+
return self._qk1
88+
89+
@property
90+
def qk2(self):
91+
return self._qk2
92+
93+
@property
94+
def qk3(self):
95+
return self._qk3
194 KB
Binary file not shown.

0 commit comments

Comments
 (0)