Skip to content

Commit 2add622

Browse files
committed
fixed yumi gripper
1 parent 2e9709d commit 2add622

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

roboticstoolbox/models/URDF/YuMi.py

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env python
22

3+
from roboticstoolbox.robot.ELink import ELink
34
import numpy as np
45
from roboticstoolbox.robot.ERobot import ERobot
6+
import spatialmath as sm
57

68

79
class YuMi(ERobot):
@@ -36,17 +38,48 @@ def __init__(self):
3638
"yumi_description/urdf/yumi.urdf"
3739
)
3840

41+
# We wish to add an intermediate link between gripper_r_base and
42+
# @gripper_r_finger_r/l
43+
# This is because gripper_r_base contains a revolute joint which is
44+
# a part of the core kinematic chain and not the gripper.
45+
# So we wish for gripper_r_base to be part of the robot and
46+
# @gripper_r_finger_r/l to be in the gripper underneath a parent ELink
47+
48+
gripper_r_base = links[16]
49+
gripper_l_base = links[19]
50+
51+
# Find the finger links
52+
r_gripper_links = [link for link in links if link.parent == gripper_r_base]
53+
l_gripper_links = [link for link in links if link.parent == gripper_l_base]
54+
55+
# New intermediate links
56+
r_gripper = ELink(name="r_gripper", parent=gripper_l_base)
57+
l_gripper = ELink(name="l_gripper", parent=gripper_r_base)
58+
links.append(r_gripper)
59+
links.append(l_gripper)
60+
61+
# Set the finger link parent to be the new gripper base link
62+
for g_link in r_gripper_links:
63+
g_link._parent = r_gripper
64+
65+
for g_link in l_gripper_links:
66+
g_link._parent = l_gripper
67+
3968
super().__init__(
4069
links,
4170
name=name,
4271
manufacturer="ABB",
43-
gripper_links=[links[20]],
72+
gripper_links=[r_gripper, l_gripper],
4473
urdf_string=urdf_string,
4574
urdf_filepath=urdf_filepath,
4675
)
4776

48-
self.addconfiguration("qz", np.zeros((14,)))
49-
self.addconfiguration("qr", np.array([0, -0.3, 0, -2.2, 0, 2.0, np.pi / 4]))
77+
# Set the default tool transform for the end-effectors
78+
self.grippers[0].tool = sm.SE3.Tz(0.13)
79+
self.grippers[1].tool = sm.SE3.Tz(0.13)
80+
81+
# self.addconfiguration("qz", np.zeros((14,)))
82+
# self.addconfiguration("qr", np.array([0, -0.3, 0, -2.2, 0, 2.0, np.pi / 4]))
5083

5184

5285
if __name__ == "__main__": # pragma nocover

0 commit comments

Comments
 (0)