(xml_path, check_model=None)
Writes a description of the most recently loaded model to an MJCF XML file.

  Args:
    xml_path: Path to the output XML file.
    check_model: Optional `MjModel` instance. If specified, this model will be
      checked to see if it is the most recently parsed one, and a ValueError
      will be raised otherwise.
  Raises:
    Error: If MuJoCo encounters an error while writing the XML file.
    ValueError: If `check_model` was passed, and this model is not the most
      recently parsed one.
Writes a description of the most recently loaded model to an MJCF XML file.
Writes a description of the most recently loaded model to an MJCF XML file .
def save_last_parsed_model_to_xml(xml_path, check_model=None):
  """Writes a description of the most recently loaded model to an MJCF XML file.

  Args:
    xml_path: Path to the output XML file.
    check_model: Optional `MjModel` instance. If specified, this model will be
      checked to see if it is the most recently parsed one, and a ValueError
      will be raised otherwise.
  Raises:
    Error: If MuJoCo encounters an error while writing the XML file.
    ValueError: If `check_model` was passed, and this model is not the most
      recently parsed one.
  """
  if check_model and check_model.ptr is not _LAST_PARSED_MODEL_PTR:
    raise ValueError(_NOT_LAST_PARSED_ERROR)
  error_buf = ctypes.create_string_buffer(_ERROR_BUFSIZE)
  mjlib.mj_saveLastXML(util.to_binary_string(xml_path),
                       _LAST_PARSED_MODEL_PTR,
                       error_buf,
                       _ERROR_BUFSIZE)
  if error_buf.value:
    raise Error(error_buf.value)
def save_last_parsed_model_to_xml ( xml_path , check_model = None ) : if check_model and check_model . ptr is not _LAST_PARSED_MODEL_PTR : raise ValueError ( _NOT_LAST_PARSED_ERROR ) error_buf = ctypes . create_string_buffer ( _ERROR_BUFSIZE ) mjlib . mj_saveLastXML ( util . to_binary_string ( xml_path ) , _LAST_PARSED_MODEL_PTR , error_buf , _ERROR_BUFSIZE ) if error_buf . value : raise Error ( error_buf . value )