rofunc.utils.robolab.formatter.mjcf_parser.export_with_assets#
Saves Mujoco models with relevant assets.
1. Module Contents#
1.1. Functions#
Saves mjcf.model in the given directory in MJCF (XML) format. |
1.2. API#
- rofunc.utils.robolab.formatter.mjcf_parser.export_with_assets.export_with_assets(mjcf_model, out_dir, out_file_name=None, *, precision=constants.XML_DEFAULT_PRECISION, zero_threshold=0)[source]#
Saves mjcf.model in the given directory in MJCF (XML) format.
Creates an MJCF XML file named out_file_name in the specified out_dir, and writes all of its assets into the same directory.
- Args:
mjcf_model: mjcf.RootElement instance to export. out_dir: Directory to save the model and assets. Will be created if it does
not already exist.
- out_file_name: (Optional) Name of the XML file to create. Defaults to the
model name (mjcf_model.model) suffixed with ‘.xml’.
- 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.
- Raises:
ValueError: If out_file_name is a string that does not end with ‘.xml’.