A named constructor from a path to an MJCF XML file. Args: file_path: String containing path to model definition file. Returns: A new `Physics` instance.
(cls, file_path)
| 473 | |
| 474 | @classmethod |
| 475 | def from_xml_path(cls, file_path): |
| 476 | """A named constructor from a path to an MJCF XML file. |
| 477 | |
| 478 | Args: |
| 479 | file_path: String containing path to model definition file. |
| 480 | |
| 481 | Returns: |
| 482 | A new `Physics` instance. |
| 483 | """ |
| 484 | model = wrapper.MjModel.from_xml_path(file_path) |
| 485 | return cls.from_model(model) |
| 486 | |
| 487 | @classmethod |
| 488 | def from_binary_path(cls, file_path): |