Skip to content

Commit e7b6fa8

Browse files
committed
Fix rne for symbolic calculations
1 parent 4ef2ef8 commit e7b6fa8

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

roboticstoolbox/robot/Robot.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -1762,10 +1762,6 @@ def rne(
17621762
else:
17631763
Q = np.empty((l, n)) # joint torque/force
17641764

1765-
qn = np.empty((l, n))
1766-
qdn = np.empty((l, n))
1767-
qddn = np.empty((l, n))
1768-
17691765
link_groups: List[List[int]] = []
17701766

17711767
# Group links together based on whether they are joints or not
@@ -1820,14 +1816,23 @@ def rne(
18201816
vJ = SpatialVelocity(s[j] * qdk[jindex])
18211817

18221818
# transform from parent(j) to j
1823-
Xup_int = SE3()
1819+
# Xup_int = SE3()
1820+
first_element = True
18241821
for idx in group:
18251822
link = self.links[idx]
18261823

18271824
if link.isjoint and link.jindex is not None:
1828-
Xup_int = Xup_int * SE3(link.A(qk[link.jindex]))
1825+
if first_element:
1826+
Xup_int = SE3(link.A(qk[link.jindex]))
1827+
first_element = False
1828+
else:
1829+
Xup_int = Xup_int * SE3(link.A(qk[link.jindex]))
18291830
else:
1830-
Xup_int = Xup_int * SE3(link.A())
1831+
if first_element:
1832+
Xup_int = SE3(link.A())
1833+
first_element = False
1834+
else:
1835+
Xup_int = Xup_int * SE3(link.A())
18311836

18321837
Xup[j] = Xup_int.inv()
18331838

0 commit comments

Comments
 (0)