(self, element_name, **kwargs)
return new_element
Add a new child element to this element.

    Args:
      element_name: The tag of the element to add.
      **kwargs: Attributes of the new element being created.

    Raises:
      ValueError: If the 'element_name' is not a valid child, or if an invalid
        attribute is specified in `kwargs`.

    Returns:
      An `mjcf.Element` corresponding to the newly created child element.
Add a new child element to this element.
Add a new child element to this element .
def add(self, element_name, **kwargs):
    """Add a new child element to this element.

    Args:
      element_name: The tag of the element to add.
      **kwargs: Attributes of the new element being created.

    Raises:
      ValueError: If the 'element_name' is not a valid child, or if an invalid
        attribute is specified in `kwargs`.

    Returns:
      An `mjcf.Element` corresponding to the newly created child element.
    """
    child_spec = self._check_valid_child(element_name)
    if child_spec.on_demand:
      need_new_on_demand = self.get_children(element_name) is None
    else:
      need_new_on_demand = False
    if not (child_spec.repeated or need_new_on_demand):
      raise ValueError('A <{}> child already exists, please access it directly.'
                       .format(element_name))
    new_element = _make_element(child_spec, self, attributes=kwargs)
    self._children.append(new_element)
    self.namescope.increment_revision()
    return new_element
def add ( self , element_name , * * kwargs ) : child_spec = self . _check_valid_child ( element_name ) if child_spec . on_demand : need_new_on_demand = self . get_children ( element_name ) is None else : need_new_on_demand = False if not ( child_spec . repeated or need_new_on_demand ) : raise ValueError ( 'A <{}> child already exists, please access it directly.' . format ( element_name ) ) new_element = _make_element ( child_spec , self , attributes = kwargs ) self . _children . append ( new_element ) self . namescope . increment_revision ( ) return new_element