Skip to content

Commit 19ff60f

Browse files
committed
Move geometry copy
1 parent bbd68f2 commit 19ff60f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

roboticstoolbox/robot/ELink.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def __str__(self):
6161

6262
def copy(self, parent=None):
6363
new = super().copy()
64+
65+
new._geometry = [shape.copy() for shape in self._geometry]
66+
new._collision = [shape.copy() for shape in self._collision]
67+
6468
# invalidate references to parent, child
6569
new._parent = parent
6670
new._children = []

roboticstoolbox/robot/Link.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ def copy(self):
170170
if k.startswith("_") and isinstance(v, np.ndarray):
171171
setattr(new, k, np.copy(v))
172172

173-
new._geometry = [shape.copy() for shape in self._geometry]
174-
new._collision = [shape.copy() for shape in self._collision]
173+
# if isinstance(self, rtb.ELink):
174+
# new._geometry = [shape.copy() for shape in self._geometry]
175+
# new._collision = [shape.copy() for shape in self._collision]
175176

176177
# print(new._geometry[0]._wT)
177178
# print(self._geometry[0]._wT)

0 commit comments

Comments
 (0)