twizy_description/src/twizy_description/robot_description.py
def xml(self, doc, robot):
        """Represent this joint and all its children as xml"""

        # A joint is only valid if it has both a parent and a child
        if self.parent and self.child:
            joint = doc.createElement('joint')
            joint.setAttribute('type', self.type)
            joint.setAttribute('name', self.name)

            parent = doc.createElement('parent')
            parent.setAttribute('link', self.parent.name)
            joint.appendChild(parent)

            child = doc.createElement('child')
            child.setAttribute('link', self.child.name)
            joint.appendChild(child)

            xyz, rpy = xyz_rpy(self.trans)
            origin = doc.createElement('origin')
            origin.setAttribute('xyz', ' '.join(str(a) for a in xyz))
            origin.setAttribute('rpy', ' '.join(str(a) for a in rpy))
            joint.appendChild(origin)

            if self.type != 'fixed':
                axis = doc.createElement('axis')
                axis.setAttribute('xyz', self.params.fields['axis'])
                joint.appendChild(axis)

            robot.appendChild(joint)

            self.child.xml(doc, robot)
Represent this joint and all its children as xml
Represent this joint and all its children as xml
Represent this joint and all its children as xml
def xml(self, doc, robot):
        if self.parent and self.child:
            joint = doc.createElement('joint')
            joint.setAttribute('type', self.type)
            joint.setAttribute('name', self.name)
            parent = doc.createElement('parent')
            parent.setAttribute('link', self.parent.name)
            joint.appendChild(parent)
            child = doc.createElement('child')
            child.setAttribute('link', self.child.name)
            joint.appendChild(child)
            xyz, rpy = xyz_rpy(self.trans)
            origin = doc.createElement('origin')
            origin.setAttribute('xyz', ' '.join(str(a) for a in xyz))
            origin.setAttribute('rpy', ' '.join(str(a) for a in rpy))
            joint.appendChild(origin)
            if self.type != 'fixed':
                axis = doc.createElement('axis')
                axis.setAttribute('xyz', self.params.fields['axis'])
                joint.appendChild(axis)
            robot.appendChild(joint)
            self.child.xml(doc, robot)
def xml ( self , doc , robot ) : if self . parent and self . child : joint = doc . createElement ( 'joint' ) joint . setAttribute ( 'type' , self . type ) joint . setAttribute ( 'name' , self . name ) parent = doc . createElement ( 'parent' ) parent . setAttribute ( 'link' , self . parent . name ) joint . appendChild ( parent ) child = doc . createElement ( 'child' ) child . setAttribute ( 'link' , self . child . name ) joint . appendChild ( child ) xyz , rpy = xyz_rpy ( self . trans ) origin = doc . createElement ( 'origin' ) origin . setAttribute ( 'xyz' , ' ' . join ( str ( a ) for a in xyz ) ) origin . setAttribute ( 'rpy' , ' ' . join ( str ( a ) for a in rpy ) ) joint . appendChild ( origin ) if self . type != 'fixed' : axis = doc . createElement ( 'axis' ) axis . setAttribute ( 'xyz' , self . params . fields [ 'axis' ] ) joint . appendChild ( axis ) robot . appendChild ( joint ) self . child . xml ( doc , robot )
Represent this joint and all its children as xml
Represent this joint and all its children as xml
"""Represent this joint and all its children as xml""" # A joint is only valid if it has both a parent and a child
self
doc
robot