55"""
66
77import numpy as np
8+ from spatialmath import base
89import roboticstoolbox as rtb
910import copy
1011import os
@@ -1611,10 +1612,9 @@ def __init__(self, name, links, joints=None,
16111612 # why arent the other things validated
16121613 try :
16131614 self ._validate_transmissions ()
1614- except :
1615+ except BaseException :
16151616 pass
16161617
1617-
16181618 self .name = name
16191619 self .other_xml = other_xml
16201620
@@ -1624,20 +1624,20 @@ def __init__(self, name, links, joints=None,
16241624 self ._transmissions = list (transmissions )
16251625 # self._materials = list(materials)
16261626
1627- # check for duplicate names
1628-
1627+ # check for duplicate names
16291628 if len (self ._links ) > len (set ([x .name for x in self ._links ])):
16301629 raise ValueError ('Duplicate link names' )
16311630 if len (self ._joints ) > len (set ([x .name for x in self ._joints ])):
16321631 raise ValueError ('Duplicate joint names' )
1633- if len (self ._transmissions ) > len (set ([x .name for x in self ._transmissions ])):
1634- raise ValueError ('Duplicate transmission names' )
1632+ if len (self ._transmissions ) > len (
1633+ set ([x .name for x in self ._transmissions ])):
1634+ raise ValueError ('Duplicate transmission names' )
16351635
16361636 elinks = []
16371637 elinkdict = {}
1638- jointdict = {}
1638+ # jointdict = {}
16391639
1640- ## build the list of links in URDF file order
1640+ # build the list of links in URDF file order
16411641 for link in self ._links :
16421642 elink = rtb .ELink (name = link .name )
16431643 elinks .append (elink )
@@ -1660,7 +1660,7 @@ def __init__(self, name, links, joints=None,
16601660 except AttributeError : # pragma nocover
16611661 pass
16621662
1663- ## connect the links using joint info
1663+ # connect the links using joint info
16641664 for joint in self ._joints :
16651665 # get references to joint's parent and child
16661666 childlink = elinkdict [joint .child ]
@@ -1671,12 +1671,14 @@ def __init__(self, name, links, joints=None,
16711671
16721672 # constant part of link transform
16731673 trans = sm .SE3 (joint .origin ).t
1674- # TODO, find where reverse is used and change it to [::-1] or do that here
1675- rot = joint .rpy [::- 1 ]
1674+ # TODO, find where reverse is used and change
1675+ # it to [::-1] or do that here
1676+ rot = joint .rpy
16761677 childlink ._ets = rtb .ETS .SE3 (trans , rot )
1678+ childlink ._init_Ts ()
16771679
16781680 # variable part of link transform
1679- if joint .joint_type in ('revolute' , 'continuous' ): # pragma nocover
1681+ if joint .joint_type in ('revolute' , 'continuous' ): # pragma nocover # noqa
16801682 if joint .axis [0 ] == 1 :
16811683 var = rtb .ETS .rx ()
16821684 elif joint .axis [0 ] == - 1 :
@@ -1826,8 +1828,6 @@ def __init__(self, name, links, joints=None,
18261828 # )
18271829 # elinks_dict[elinks[-1].name] = elinks[-1]
18281830
1829-
1830-
18311831 # elinks.append(base_link)
18321832 # self.elinks = elinks
18331833
0 commit comments