MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / add

Method add

dm_control/mjcf/element.py:616–630  ·  view source on GitHub ↗

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`.

(self, element_name, **kwargs)

Source from the content-addressed store, hash-verified

614 .format(element_name, self._spec.name))
615
616 def add(self, element_name, **kwargs):
617 """Add a new child element to this element.
618
619 Args:
620 element_name: The tag of the element to add.
621 **kwargs: Attributes of the new element being created.
622
623 Raises:
624 ValueError: If the 'element_name' is not a valid child, or if an invalid
625 attribute is specified in `kwargs`.
626
627 Returns:
628 An `mjcf.Element` corresponding to the newly created child element.
629 """
630 return self.insert(element_name, position=None, **kwargs)
631
632 def insert(self, element_name, position, **kwargs):
633 """Add a new child element to this element.

Callers 2

__dir__Method · 0.45
__init__Method · 0.45

Calls 1

insertMethod · 0.95

Tested by

no test coverage detected