Reloads the `Physics` instance from a string containing an MJCF XML file. After calling this method, the state of the `Physics` instance is the same as a new `Physics` instance created with the `from_xml_string` named constructor. Args: xml_string: XML string containing an MJ
(self, xml_string, assets=None)
| 498 | return cls.from_model(model) |
| 499 | |
| 500 | def reload_from_xml_string(self, xml_string, assets=None): |
| 501 | """Reloads the `Physics` instance from a string containing an MJCF XML file. |
| 502 | |
| 503 | After calling this method, the state of the `Physics` instance is the same |
| 504 | as a new `Physics` instance created with the `from_xml_string` named |
| 505 | constructor. |
| 506 | |
| 507 | Args: |
| 508 | xml_string: XML string containing an MJCF model description. |
| 509 | assets: Optional dict containing external assets referenced by the model |
| 510 | (such as additional XML files, textures, meshes etc.), in the form of |
| 511 | `{filename: contents_string}` pairs. The keys should correspond to the |
| 512 | filenames specified in the model XML. |
| 513 | """ |
| 514 | new_model = wrapper.MjModel.from_xml_string(xml_string, assets=assets) |
| 515 | self._reload_from_model(new_model) |
| 516 | |
| 517 | def reload_from_xml_path(self, file_path): |
| 518 | """Reloads the `Physics` instance from a path to an MJCF XML file. |