Skip to content

Commit eaf5b92

Browse files
committed
change SerialLink to DHRobot
1 parent 7916b47 commit eaf5b92

File tree

3 files changed

+65
-65
lines changed

3 files changed

+65
-65
lines changed

roboticstoolbox/robot/SerialLink.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ def __init__(
8383
self._n += 1
8484
L[i].id = self._n
8585

86-
elif isinstance(L[i], SerialLink):
86+
elif isinstance(L[i], DHRobot):
8787
for j in range(L[i].n):
8888
self._links.append(L[i].links[j])
8989
self._n += 1
9090
L[i].id = self._n
9191

9292
else:
93-
raise TypeError("Input can be only DHLink or SerialLink")
93+
raise TypeError("Input can be only DHLink or DHRobot")
9494

9595
# Current joint angles of the robot
9696
self.q = np.zeros(self.n)
@@ -164,14 +164,14 @@ def __add__(self, L):
164164

165165
if isinstance(L, DHLink):
166166
nlinks.append(L)
167-
elif isinstance(L, SerialLink):
167+
elif isinstance(L, DHRobot):
168168
for j in range(L.n):
169169
nlinks.append(L.links[j])
170170
else:
171-
raise TypeError("Can only combine SerialLinks with other "
172-
"SerialLinks or DHLinks")
171+
raise TypeError("Can only combine DHRobots with other "
172+
"DHRobots or DHLinks")
173173

174-
return SerialLink(
174+
return DHRobot(
175175
nlinks,
176176
name=self.name,
177177
manufacturer=self.manuf,
@@ -185,7 +185,7 @@ def _copy(self):
185185
for i in range(self.n):
186186
L.append(self.links[i]._copy())
187187

188-
r2 = SerialLink(
188+
r2 = DHRobot(
189189
L,
190190
name=self.name,
191191
manufacturer=self.manuf,

tests/test_Link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def test_add(self):
128128
l0 = rp.DHLink()
129129
l1 = rp.DHLink()
130130

131-
self.assertIsInstance(l0 + l1, rp.SerialLink)
131+
self.assertIsInstance(l0 + l1, rp.DHRobot)
132132
self.assertRaises(TypeError, l0.__add__, 1)
133133

134134
def test_properties(self):

0 commit comments

Comments
 (0)