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

Method to_xml

dm_control/mjcf/element.py:1161–1183  ·  view source on GitHub ↗
(self, prefix_root=None, debug_context=None,
             *,
             precision=constants.XML_DEFAULT_PRECISION,
             zero_threshold=0,
             filename_with_hash=True)

Source from the content-addressed store, hash-verified

1159 return [child for child in self._children]
1160
1161 def to_xml(self, prefix_root=None, debug_context=None,
1162 *,
1163 precision=constants.XML_DEFAULT_PRECISION,
1164 zero_threshold=0,
1165 filename_with_hash=True):
1166 prefix_root = prefix_root or self.namescope
1167 xml_element = (super().to_xml(prefix_root, debug_context,
1168 precision=precision,
1169 zero_threshold=zero_threshold,
1170 filename_with_hash=filename_with_hash))
1171 if isinstance(self._parent, RootElement):
1172 root_default = etree.Element(self._spec.name)
1173 root_default.append(xml_element)
1174 for attachment in self._attachments.values():
1175 attachment_xml = attachment.to_xml(
1176 prefix_root, debug_context,
1177 precision=precision,
1178 zero_threshold=zero_threshold,
1179 filename_with_hash=filename_with_hash)
1180 for attachment_child_xml in attachment_xml:
1181 root_default.append(attachment_child_xml)
1182 xml_element = root_default
1183 return xml_element
1184
1185
1186class _ActuatorElement(_ElementImpl):

Callers

nothing calls this directly

Calls 2

valuesMethod · 0.80
to_xmlMethod · 0.45

Tested by

no test coverage detected