@@ -1719,7 +1719,6 @@ def rne(
1719
1719
1720
1720
# allocate intermediate variables
1721
1721
Xup = SE3 .Alloc (n )
1722
- Xtree = SE3 .Alloc (n )
1723
1722
1724
1723
v = SpatialVelocity .Alloc (n )
1725
1724
a = SpatialAcceleration .Alloc (n )
@@ -1738,42 +1737,22 @@ def rne(
1738
1737
else :
1739
1738
Q = np .empty ((l , n )) # joint torque/force
1740
1739
1741
- # TODO Should the dynamic parameters of static links preceding joint be
1742
- # somehow merged with the joint?
1743
-
1744
- # A temp variable to handle static joints
1745
- Ts = SE3 ()
1746
-
1747
- # A counter through joints
1748
- j = 0
1749
-
1750
1740
for k in range (l ):
1751
1741
qk = q [k , :]
1752
1742
qdk = qd [k , :]
1753
1743
qddk = qdd [k , :]
1754
1744
1755
1745
# initialize intermediate variables
1756
- for link in self .links :
1746
+ for j , link in enumerate ( self .links ) :
1757
1747
if link .isjoint :
1758
1748
I [j ] = SpatialInertia (m = link .m , r = link .r )
1759
- if symbolic and link .Ts is None : # pragma: nocover
1760
- Xtree [j ] = SE3 (np .eye (4 , dtype = "O" ), check = False )
1761
- elif link .Ts is not None :
1762
- Xtree [j ] = Ts * SE3 (link .Ts , check = False )
1763
1749
1764
1750
if link .v is not None :
1765
1751
s .append (link .v .s )
1766
1752
1767
1753
# Increment the joint counter
1768
1754
j += 1
1769
1755
1770
- # Reset the Ts tracker
1771
- Ts = SE3 ()
1772
- else : # pragma nocover
1773
- # TODO Keep track of inertia and transform???
1774
- if link .Ts is not None :
1775
- Ts *= SE3 (link .Ts , check = False )
1776
-
1777
1756
if gravity is None :
1778
1757
a_grav = - SpatialAcceleration (self .gravity )
1779
1758
else : # pragma nocover
@@ -1787,13 +1766,15 @@ def rne(
1787
1766
if self .links [j ].jindex is not None :
1788
1767
Xup [j ] = SE3 (self .links [j ].A (qk [self .links [j ].jindex ])).inv ()
1789
1768
else :
1769
+ # If fixed link between parent and child
1790
1770
Xup [j ] = SE3 (self .links [j ].A ()).inv ()
1791
1771
1792
1772
if self .links [j ].parent is None :
1793
1773
v [j ] = vJ
1794
1774
a [j ] = Xup [j ] * a_grav + SpatialAcceleration (s [j ] * qddk [j ])
1795
1775
else :
1796
1776
jp = self .links [j ].parent .jindex # type: ignore
1777
+ breakpoint ()
1797
1778
v [j ] = Xup [j ] * v [jp ] + vJ
1798
1779
a [j ] = (
1799
1780
Xup [j ] * a [jp ] + SpatialAcceleration (s [j ] * qddk [j ]) + v [j ] @ vJ
0 commit comments