twizy_description/src/twizy_description/robot_description.py
def proto_str(self, name, fields=[], header=''):
        """Generate a PROTO string representation of this node tree

        :param name: Name of the PROTO (must be the same as an eventual file
            name according to webots specifications)
        :type name: str
        :param fields: List of field definitions for the generated PROTO, one
            list element might for example be
            'field SFVec3f translation 0.0 0.0 0.0'
        :type fields: list
        :param header: A header to put in a comment at the start of the
            generated PROTO
        :type header: str

        :return: A PROTO string representation of this node and it's children
        """

        out = _IndentedOutput()
        out.write('#VRML_SIM R2021a utf8')
        for line in header.split('\n'):
            out.write(('' if not line or line.isspace() else '# ') + line)
        out.write(f'PROTO {name} [')
        for field in fields:
            out.write(field, 1)
        out.write(']')
        out.write('{')
        self._proto(out.indent())
        out.write('}')

        return str(out)
Generate a PROTO string representation of this node tree

        :param name: Name of the PROTO (must be the same as an eventual file
            name according to webots specifications)
        :type name: str
        :param fields: List of field definitions for the generated PROTO, one
            list element might for example be
            'field SFVec3f translation 0.0 0.0 0.0'
        :type fields: list
        :param header: A header to put in a comment at the start of the
            generated PROTO
        :type header: str

        :return: A PROTO string representation of this node and it's children
        
Generate a PROTO string representation of this node tree
Generate a PROTO string representation of this node tree
def proto_str(self, name, fields=[], header=''):
        out = _IndentedOutput()
        out.write('#VRML_SIM R2021a utf8')
        for line in header.split('\n'):
            out.write(('' if not line or line.isspace() else '# ') + line)
        out.write(f'PROTO {name} [')
        for field in fields:
            out.write(field, 1)
        out.write(']')
        out.write('{')
        self._proto(out.indent())
        out.write('}')
        return str(out)
def proto_str ( self , name , fields = [ ] , header = '' ) : out = _IndentedOutput ( ) out . write ( '#VRML_SIM R2021a utf8' ) for line in header . split ( '\n' ) : out . write ( ( '' if not line or line . isspace ( ) else '# ' ) + line ) out . write ( f'PROTO {name} [' ) for field in fields : out . write ( field , 1 ) out . write ( ']' ) out . write ( '{' ) self . _proto ( out . indent ( ) ) out . write ( '}' ) return str ( out )
Generate a PROTO string representation of this node tree
Generate a PROTO string representation of this node tree
"""Generate a PROTO string representation of this node tree

        :param name: Name of the PROTO (must be the same as an eventual file
            name according to webots specifications)
        :type name: str
        :param fields: List of field definitions for the generated PROTO, one
            list element might for example be
            'field SFVec3f translation 0.0 0.0 0.0'
        :type fields: list
        :param header: A header to put in a comment at the start of the
            generated PROTO
        :type header: str

        :return: A PROTO string representation of this node and it's children
        """
A PROTO string representation of this node and it's children
A PROTO string representation of this node and it ' s children
self
name
Name of the PROTO (must be the same as an eventual file
name according to webots specifications)
Name of the PROTO ( must be the same as an eventual file name according to webots specifications )
fields
List of field definitions for the generated PROTO, one
list element might for example be
'field SFVec3f translation 0.0 0.0 0.0'
List of field definitions for the generated PROTO one list element might for example be ' field SFVec3f translation 0 . 0 0 . 0 0 . 0 '
header
A header to put in a comment at the start of the
generated PROTO
A header to put in a comment at the start of the generated PROTO