Skip to content

Commit a131f3d

Browse files
committed
URDFs working
1 parent 4f06f03 commit a131f3d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

roboticstoolbox/backends/PyPlot/RobotPlot.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def axes_calcs(self):
8181
# Joint axes arrow calcs
8282
if isinstance(self.robot, rp.ERobot):
8383
i = 0
84+
j = 0
8485
for link in self.robot.links:
8586
loc[:, i + 1] = link._fk.t
8687

@@ -94,7 +95,8 @@ def axes_calcs(self):
9495
elif link.v.axis == 'Rx' or link.v.axis == 'tx':
9596
Tji = link._fk * Tjx
9697

97-
joints[:, i] = Tji.t
98+
joints[:, j] = Tji.t
99+
j += 1
98100

99101
i += 1
100102
loc = np.c_[loc, loc[:, -1]]
@@ -211,9 +213,14 @@ def init(self):
211213

212214
# Plot joint z coordinates
213215
if self.jointaxes:
214-
for i in range(self.robot.n):
215-
self.joints.append(
216-
self._plot_quiver(loc[:, i+1], joints[:, i], '#8FC1E2', 2))
216+
j = 0
217+
for i in range(len(self.robot.links)):
218+
if isinstance(self.robot, rp.DHRobot) or \
219+
self.robot.links[i].isjoint:
220+
self.joints.append(
221+
self._plot_quiver(
222+
loc[:, i+1], joints[:, j], '#8FC1E2', 2))
223+
j += 1
217224

218225
# Plot the shadow of the robot links, draw first so robot is always
219226
# in front

0 commit comments

Comments
 (0)