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

Method to_xml_string

dm_control/mjcf/base.py:249–275  ·  view source on GitHub ↗

Generates an XML string corresponding to this MJCF element. Args: prefix_root: (optional) A `NameScope` object to be treated as root for the purpose of calculating the prefix. If `None` then no prefix is included. self_only: (optional) A boolean, whether to generate

(self, prefix_root=None,
                    self_only=False, pretty_print=True, debug_context=None,
                    *,
                    precision=constants.XML_DEFAULT_PRECISION,
                    zero_threshold=0)

Source from the content-addressed store, hash-verified

247
248 @abc.abstractmethod
249 def to_xml_string(self, prefix_root=None,
250 self_only=False, pretty_print=True, debug_context=None,
251 *,
252 precision=constants.XML_DEFAULT_PRECISION,
253 zero_threshold=0):
254 """Generates an XML string corresponding to this MJCF element.
255
256 Args:
257 prefix_root: (optional) A `NameScope` object to be treated as root
258 for the purpose of calculating the prefix.
259 If `None` then no prefix is included.
260 self_only: (optional) A boolean, whether to generate an XML corresponding
261 only to this element without any children.
262 pretty_print: (optional) A boolean, whether to the XML string should be
263 properly indented.
264 debug_context: (optional) A `debugging.DebugContext` object to which
265 the debugging information associated with the generated XML is written.
266 This is intended for internal use within PyMJCF; users should never need
267 manually pass this argument.
268 precision: (optional) Number of digits to output for floating point
269 quantities.
270 zero_threshold: (optional) When outputting XML, floating point quantities
271 whose absolute value falls below this threshold will be treated as zero.
272
273 Returns:
274 A string.
275 """
276
277 @abc.abstractmethod
278 def resolve_references(self):

Callers 15

testAttachMethod · 0.45
testDetachMethod · 0.45
testAttachmentFramesMethod · 0.45
testDeletionMethod · 0.45
testDefaultIdentifierMethod · 0.45
export_with_assetsFunction · 0.45
test_export_modelMethod · 0.45

Calls

no outgoing calls

Tested by 15

testAttachMethod · 0.36
testDetachMethod · 0.36
testAttachmentFramesMethod · 0.36
testDeletionMethod · 0.36
testDefaultIdentifierMethod · 0.36
test_export_modelMethod · 0.36
setUpMethod · 0.36
test_bind_mocap_bodyMethod · 0.36