Skip to content

Commit

Permalink
Merge branch 'future' of github.com:petercorke/robotics-toolbox-pytho…
Browse files Browse the repository at this point in the history
…n into future
  • Loading branch information
jhavl committed Jul 29, 2024
2 parents e7b6fa8 + 4f0d3ff commit fdf3cf5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
33 changes: 29 additions & 4 deletions roboticstoolbox/models/DH/UR10.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class UR10(DHRobot):
""" # noqa

def __init__(self, symbolic=False):

if symbolic:
import spatialmath.base.symbolic as sym

Expand All @@ -59,7 +58,7 @@ def __init__(self, symbolic=False):

alpha = [pi / 2, zero, zero, pi / 2, -pi / 2, zero]

# mass data, no inertia available
# mass data
mass = [7.1, 12.7, 4.27, 2.000, 2.000, 0.365]
center_of_mass = [
[0.021, 0, 0.027],
Expand All @@ -69,11 +68,38 @@ def __init__(self, symbolic=False):
[0.0, 0.007, 0.018],
[0, 0, -0.026],
]

# inertia matrices for each link
inertia = [
np.array(
[[0.0341, 0, -0.0043], [0, 0.0353, 0.0001], [-0.0043, 0.0001, 0.0216]]
),
np.array(
[[0.0281, 0.0001, -0.0156], [0.0001, 0.7707, 0], [-0.0156, 0, 0.7694]]
),
np.array(
[[0.0101, 0.0001, 0.0092], [0.0001, 0.3093, 0], [0.0092, 0, 0.3065]]
),
np.array(
[[0.0030, -0.0000, 0], [-0.0000, 0.0022, -0.0002], [0, -0.0002, 0.0026]]
),
np.array(
[[0.0030, -0.0000, 0], [-0.0000, 0.0022, -0.0002], [0, -0.0002, 0.0026]]
),
np.array([[0, 0, 0], [0, 0.0004, 0], [0, 0, 0.0003]]),
]

links = []

for j in range(6):
link = RevoluteDH(
d=d[j], a=a[j], alpha=alpha[j], m=mass[j], r=center_of_mass[j], G=1
d=d[j],
a=a[j],
alpha=alpha[j],
m=mass[j],
r=center_of_mass[j],
G=1,
I=inertia[j],
)
links.append(link)

Expand All @@ -93,7 +119,6 @@ def __init__(self, symbolic=False):


if __name__ == "__main__": # pragma nocover

ur10 = UR10(symbolic=False)
print(ur10)
# print(ur10.dyntable())
2 changes: 2 additions & 0 deletions roboticstoolbox/tools/urdf/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ def filename(self, value):

if value.startswith("package://"):
value = value.replace("package://", "")
elif value.startswith("file://"):
value = value.replace("file://", "")

if _base_path is None:
value = rtb_path_to_datafile("xacro", value)
Expand Down

0 comments on commit fdf3cf5

Please sign in to comment.