rofunc.utils.robolab.formatter.mjcf_parser.export_with_assets_as_zip#
Saves Mujoco models with relevant assets in a .zip file.
1. Module Contents#
1.1. Functions#
Saves mjcf_model and all its assets as a .zip file in the given directory. |
1.2. API#
- rofunc.utils.robolab.formatter.mjcf_parser.export_with_assets_as_zip.export_with_assets_as_zip(mjcf_model, out_dir, model_name=None, *, precision=constants.XML_DEFAULT_PRECISION, zero_threshold=0)[source]#
Saves mjcf_model and all its assets as a .zip file in the given directory.
Creates a .zip file named model_name.zip in the specified out_dir, and a directory inside of this file named model_name. The MJCF XML is written into this directory with the name model_name.xml, and all the assets are also written into this directory without changing their names.
- Args:
mjcf_model: mjcf.RootElement instance to export. out_dir: Directory to save the .zip file. Will be created if it does not
already exist.
- model_name: (Optional) Name of the .zip file, the name of the directory
inside the .zip root containing the model and assets, and name of the XML file inside this directory. Defaults to the MJCF model name (mjcf_model.model).
- precision: (optional) Number of digits to output for floating point
quantities.
- zero_threshold: (optional) When outputting XML, floating point quantities
whose absolute value falls below this threshold will be treated as zero.
- Returns:
The full path to the .zip file.