(cls, mjcf_model)
Constructs a new `mjcf.Physics` from an `mjcf.RootElement`.

    Args:
      mjcf_model: An `mjcf.RootElement` instance.

    Returns:
      A new `mjcf.Physics` instance.
Constructs a new `mjcf.Physics` from an `mjcf.RootElement`.
Constructs a new mjcf . Physics from an mjcf . RootElement .
def from_mjcf_model(cls, mjcf_model):
    """Constructs a new `mjcf.Physics` from an `mjcf.RootElement`.

    Args:
      mjcf_model: An `mjcf.RootElement` instance.

    Returns:
      A new `mjcf.Physics` instance.
    """
    debug_context = debugging.DebugContext()
    xml_string = mjcf_model.to_xml_string(debug_context=debug_context)
    if _pymjcf_log_xml():
      if debug_context.debug_mode and debug_context.default_dump_dir:
        logging.info('Full debug info is dumped to disk at %s',
                     debug_context.default_dump_dir)
        debug_context.dump_full_debug_info_to_disk()
      else:
        logging.info('Full debug info is not yet dumped to disk. If this is '
                     'needed, pass all three flags: --pymjcf_log_xml '
                     '--pymjcf_debug --pymjcf_debug_full_dump_dir=/path/dir/')
      _log_xml(xml_string)
    assets = mjcf_model.get_assets()
    try:
      return cls.from_xml_string(xml_string=xml_string, assets=assets)
    except mujoco_wrapper.Error:
      debug_context.process_and_raise_last_exception()
def from_mjcf_model ( cls , mjcf_model ) : debug_context = debugging . DebugContext ( ) xml_string = mjcf_model . to_xml_string ( debug_context = debug_context ) if _pymjcf_log_xml ( ) : if debug_context . debug_mode and debug_context . default_dump_dir : logging . info ( 'Full debug info is dumped to disk at %s' , debug_context . default_dump_dir ) debug_context . dump_full_debug_info_to_disk ( ) else : logging . info ( 'Full debug info is not yet dumped to disk. If this is ' 'needed, pass all three flags: --pymjcf_log_xml ' '--pymjcf_debug --pymjcf_debug_full_dump_dir=/path/dir/' ) _log_xml ( xml_string ) assets = mjcf_model . get_assets ( ) try : return cls . from_xml_string ( xml_string = xml_string , assets = assets ) except mujoco_wrapper . Error : debug_context . process_and_raise_last_exception ( )