@@ -1719,7 +1719,6 @@ def rne(
17191719
17201720 # allocate intermediate variables
17211721 Xup = SE3 .Alloc (n )
1722- Xtree = SE3 .Alloc (n )
17231722
17241723 v = SpatialVelocity .Alloc (n )
17251724 a = SpatialAcceleration .Alloc (n )
@@ -1738,42 +1737,22 @@ def rne(
17381737 else :
17391738 Q = np .empty ((l , n )) # joint torque/force
17401739
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-
17501740 for k in range (l ):
17511741 qk = q [k , :]
17521742 qdk = qd [k , :]
17531743 qddk = qdd [k , :]
17541744
17551745 # initialize intermediate variables
1756- for link in self .links :
1746+ for j , link in enumerate ( self .links ) :
17571747 if link .isjoint :
17581748 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 )
17631749
17641750 if link .v is not None :
17651751 s .append (link .v .s )
17661752
17671753 # Increment the joint counter
17681754 j += 1
17691755
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-
17771756 if gravity is None :
17781757 a_grav = - SpatialAcceleration (self .gravity )
17791758 else : # pragma nocover
@@ -1787,13 +1766,15 @@ def rne(
17871766 if self .links [j ].jindex is not None :
17881767 Xup [j ] = SE3 (self .links [j ].A (qk [self .links [j ].jindex ])).inv ()
17891768 else :
1769+ # If fixed link between parent and child
17901770 Xup [j ] = SE3 (self .links [j ].A ()).inv ()
17911771
17921772 if self .links [j ].parent is None :
17931773 v [j ] = vJ
17941774 a [j ] = Xup [j ] * a_grav + SpatialAcceleration (s [j ] * qddk [j ])
17951775 else :
17961776 jp = self .links [j ].parent .jindex # type: ignore
1777+ breakpoint ()
17971778 v [j ] = Xup [j ] * v [jp ] + vJ
17981779 a [j ] = (
17991780 Xup [j ] * a [jp ] + SpatialAcceleration (s [j ] * qddk [j ]) + v [j ] @ vJ
0 commit comments