DLR-RM / RAFCON

RAFCON (RMC advanced flow control) uses hierarchical state machines, featuring concurrent state execution, to represent robot programs. It ships with a graphical user interface supporting the creation of state machines and contains IDE like debugging mechanisms. Alternatively, state machines can programmatically be generated using RAFCON's API.
https://dlr-rm.github.io/RAFCON/
Eclipse Public License 1.0
181 stars 34 forks source link

symlinking a folder into a library doesn't seem to work #837

Open SebastianRiedel opened 4 years ago

SebastianRiedel commented 4 years ago

I have a setting in which I'd like to symlink a folder containing rafcon libraries into a "bigger" rafcon library. However, this setting seems to crash rafcon on startup.

Conceptually it looks like this:

my_rafcon_library/
├── A
│   └── blabla
│       ├── blabla_QHCMXS
│       │   ├── core_data.json
│       │   └── meta_data.json
│       ├── meta_data.json
│       └── statemachine.json
└── B -> /home/sr/some/folder/B

Before starting rafcon I export RAFCON_LIBRARY_PATH=.../somewhere/my_rafcon_library. The error I get is:

Traceback (most recent call last):
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/bin/rafcon", line 11, in <module>
    sys.exit(main())
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/gui/start.py", line 356, in main
    setup_mvc_configuration(user_input.config_path, user_input.gui_config_path, user_input.gui_config_path)
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/gui/start.py", line 202, in setup_mvc_configuration
    setup_configuration(core_config_path)
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/core/start.py", line 146, in setup_configuration
    core_singletons.library_manager.initialize()
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/core/library_manager.py", line 122, in initialize
    self._load_libraries_from_root_path(library_root_key, library_root_path)
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/core/library_manager.py", line 149, in _load_libraries_from_root_path
    self._load_nested_libraries(library_root_path, self._libraries[library_root_key])
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/core/library_manager.py", line 181, in _load_nested_libraries
    self._load_nested_libraries(full_library_path, target_dict[library_name])
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/core/library_manager.py", line 173, in _load_nested_libraries
    library_folder_path, library_name = self.check_clean_path_of_library(library_path, library_name)
  File "/home/sr/.conan/data/rafcon/0.14.1/ar/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676/lib/python2.7/site-packages/rafcon/core/library_manager.py", line 153, in check_clean_path_of_library
    library_root_path = self._library_root_paths[self._get_library_root_key_for_os_path(folder_path)]
KeyError: None

If I substitute the B-symlink with a physical copy of /home/sr/some/folder/B, it loads.

Not super-critical, but I had/have a use case for this.

sebastian-brunner commented 4 years ago

Thx for reporting, in general symlink shouldn't be a problem, so this is a bug.