Skip to content

Commit ae33612

Browse files
committed
Merge branch 'master' of https://github.com/petercorke/robotics-toolbox-python into micah-dev
2 parents cb24deb + dc952d9 commit ae33612

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

roboticstoolbox/models/Puma560.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,46 +79,52 @@ def __init__(self):
7979
# at the motor)
8080
Tc=[0.395, -0.435], # actuator Coulomb friction coefficient for
8181
# direction [-,+] (measured at the motor)
82-
qlim=[-160*deg, 160*deg]) # minimum and maximum joint angle
82+
qlim=[-160*deg, 160*deg], # minimum and maximum joint angle
83+
mesh='UNIMATE/puma560/link0.stl')
8384

8485
L1 = RevoluteDH(
8586
d=0, a=0.4318, alpha=0,
8687
I=[0.13, 0.524, 0.539, 0, 0, 0],
8788
r=[-0.3638, 0.006, 0.2275],
8889
m=17.4, Jm=200e-6, G=107.815,
8990
B=.817e-3, Tc=[0.126, -0.071],
90-
qlim=[-45*deg, 225*deg])
91+
qlim=[-45*deg, 225*deg],
92+
mesh='UNIMATE/puma560/link1.stl')
9193

9294
L2 = RevoluteDH(
9395
d=0.15005, a=0.0203, alpha=-pi/2,
9496
I=[0.066, 0.086, 0.0125, 0, 0, 0],
9597
r=[-0.0203, -0.0141, 0.070],
9698
m=4.8, Jm=200e-6, G=-53.7063,
9799
B=1.38e-3, Tc=[0.132, -0.105],
98-
qlim=[-225*deg, 45*deg])
100+
qlim=[-225*deg, 45*deg],
101+
mesh='UNIMATE/puma560/link2.stl')
99102

100103
L3 = RevoluteDH(
101104
d=0.4318, a=0, alpha=pi/2,
102105
I=[1.8e-3, 1.3e-3, 1.8e-3, 0, 0, 0],
103106
r=[0, 0.019, 0],
104107
m=0.82, Jm=33e-6, G=76.0364,
105108
B=71.2e-6, Tc=[11.2e-3, -16.9e-3],
106-
qlim=[-110*deg, 170*deg])
109+
qlim=[-110*deg, 170*deg],
110+
mesh='UNIMATE/puma560/link3.stl')
107111

108112
L4 = RevoluteDH(
109113
d=0, a=0, alpha=-pi/2,
110114
I=[0.3e-3, 0.4e-3, 0.3e-3, 0, 0, 0],
111115
r=[0, 0, 0], m=0.34,
112116
Jm=33e-6, G=71.923, B=82.6e-6,
113117
Tc=[9.26e-3, -14.5e-3],
114-
qlim=[-100*deg, 100*deg])
118+
qlim=[-100*deg, 100*deg],
119+
mesh='UNIMATE/puma560/link4.stl')
115120

116121
L5 = RevoluteDH(
117122
d=0, a=0, alpha=0,
118123
I=[0.15e-3, 0.15e-3, 0.04e-3, 0, 0, 0],
119124
r=[0, 0, 0.032], m=0.09, Jm=33e-6,
120125
G=76.686, B=36.7e-6, Tc=[3.96e-3, -10.5e-3],
121-
qlim=[-266*deg, 266*deg])
126+
qlim=[-266*deg, 266*deg],
127+
mesh='UNIMATE/puma560/link5.stl')
122128

123129
L = [L0, L1, L2, L3, L4, L5]
124130

@@ -136,6 +142,7 @@ def __init__(self):
136142

137143
super(Puma560, self).__init__(
138144
L,
145+
toolmesh = "UNIMATE/puma560/link6.stl",
139146
name="Puma 560",
140147
manufacturer="Unimation")
141148

roboticstoolbox/robot/Link.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Python implementation by Samuel Drew
44
"""
55

6+
from pathlib import PurePath
67
from numpy import *
78
from spatialmath.pose3d import *
89
import argparse
@@ -147,12 +148,17 @@ def __init__(self, units='rad', **kwargs):
147148
self.B = 0
148149
self.Tc = [0, 0]
149150

151+
# Meshes
152+
self.mesh = None
153+
150154
# for every passed argument, check if its a valid attribute and then set it
151155
for name, value in kwargs.items():
152156

153157
# convert angular parameters to radians if required
154158
if name in ['alpha', 'theta'] and units == 'deg':
155159
value *= pi / 180
160+
if name == 'mesh':
161+
value = PurePath(__file__).parent.parent / 'models' / 'meshes' / value
156162

157163
if name in self.__dict__:
158164
setattr(self, name, value)

roboticstoolbox/robot/serial_link.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
from pathlib import PurePath
34
import numpy as np
45
from roboticstoolbox.robot.Link import *
56
from spatialmath.pose3d import *
@@ -10,7 +11,7 @@
1011

1112
class SerialLink:
1213

13-
def __init__(self, links, name=None, base=None, tool=None, stl_files=None, q=None, param=None, manufacturer=None, comment=None, meshdir=None, configurations={}):
14+
def __init__(self, links, name=None, base=None, tool=None, toolmesh=None, stl_files=None, q=None, param=None, manufacturer=None, comment=None, meshdir=None, configurations={}):
1415
"""
1516
Creates a SerialLink object.
1617
:param links: a list of links that will constitute SerialLink object.
@@ -36,6 +37,12 @@ def __init__(self, links, name=None, base=None, tool=None, stl_files=None, q=Non
3637
else:
3738
assert (type(tool) is np.ndarray) and (tool.shape == (4, 4))
3839
self.tool = tool
40+
41+
if toolmesh:
42+
self.toolmesh = PurePath(__file__).parent.parent / 'models' / 'meshes' / toolmesh
43+
else:
44+
self.toolmesh = None
45+
3946
# Following arguments initialised by plot function and animate functions only
4047
if stl_files is None:
4148
# Default stick figure model code goes here

0 commit comments

Comments
 (0)