pycram.external_interfaces.procthor
===================================

.. py:module:: pycram.external_interfaces.procthor


Attributes
----------

.. autoapisummary::

   pycram.external_interfaces.procthor.filename


Classes
-------

.. autoapisummary::

   pycram.external_interfaces.procthor.ProcThorInterface


Module Contents
---------------

.. py:data:: filename

.. py:class:: ProcThorInterface(base_url='http://procthor.informatik.uni-bremen.de:5000', source_folder=os.path.join(ros_tools.get_ros_package_path('pycram'), 'resources/tmp/'))

   .. py:attribute:: base_url
      :value: 'http://procthor.informatik.uni-bremen.de:5000'



   .. py:attribute:: source_folder


   .. py:attribute:: stored_environments
      :value: []



   .. py:method:: _download_file(base_url: str, full_url: str, folder: str) -> str

      Downloads the file given in full_url and stores it into folder. If necessary it will create the same folder
      structure. For this purpose the base_url is necessary to decide what is folder structure and what is just url.


      :param base_url: Base url as string from
      :param full_url: Full url of the file to be downloaded
      :param folder: Folder where the file should be stored
      :return: The local file name of the downloaded file



   .. py:method:: _get_files_list(base_url: str) -> typing_extensions.Set[str]

      Function to get the list of files in a directory on the web server.

      :param base_url: Base url as string from
      :return: Set of all files found below the given url



   .. py:method:: download_all_files_from_URL(base_url: str, folder: str) -> None

      Main function to download all files from a given path. Files will be stored in folder.

      :param base_url: Base url as string from
      :param folder: folder where the files should be stored
      :return: None



   .. py:method:: get_all_environments_stored_below_directory(source_folder: str) -> list

      Returns a list of dictionaries that contains the name and the storage_place of all urdf files below a given
      folder. Only looks for urdf.

      :param source_folder: Base path as string from
      :return: map from name to storage place



   .. py:method:: download_one_random_environment() -> typing_extensions.Dict[str, str]

      Downloads one random environment currently not present.

      :param: None
      :return: Dictionary of name and storage place



   .. py:method:: download_num_random_environment(num_of_environments: int) -> list

      Downloads given amount of  random environment currently not present.

      :param num_of_environments: Amount of environments that get downloaded
      :return: List of Dictionaries of name and storage place



