Klampt icon indicating copy to clipboard operation
Klampt copied to clipboard

IsaacGym Interoperability

Open patricknaughton01 opened this issue 1 year ago • 2 comments

Klampt and IsaacGym run into some problems when using them both in the same script. Running Ubuntu 20.04 and Python 3.8.10 (IsaacGym installed in Documents directory), I get the following output:

>>> import klampt
>>> import isaacgym
*** Warning: failed to preload USD libs
Importing module 'gym_38' (Documents/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so)
[Error] [carb] [Plugin: libcarb.gym.plugin.so] Could not load the dynamic library from Documents/isaacgym/python/isaacgym/_bindings/linux-x86_64/libcarb.gym.plugin.so. Error: libmem_filesys.so: cannot open shared object file: No such file or directory
[Warning] [carb] Potential plugin preload failed: Documents/isaacgym/python/isaacgym/_bindings/linux-x86_64/libcarb.gym.plugin.so
Setting GYM_USD_PLUG_INFO_PATH to Documents/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json

and

>>> import isaacgym
Importing module 'gym_38' (Documents/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so)
Setting GYM_USD_PLUG_INFO_PATH to Documents/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
>>> import klampt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".venvs/uc_venv/lib/python3.8/site-packages/klampt/__init__.py", line 9, in <module>
    from .robotsim import *
  File ".venvs/uc_venv/lib/python3.8/site-packages/klampt/robotsim.py", line 18, in <module>
    from . import _robotsim
ImportError: .venvs/uc_venv/lib/python3.8/site-packages/klampt/_robotsim.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK2tf11Transformer15lookupTransformERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_RKN3ros4TimeERNS_16StampedTransformE

patricknaughton01 avatar Oct 02 '23 21:10 patricknaughton01

Did you compile Klampt from source? Looks like you have ROS installed and it’s looking for a ROS shared object, but something is causing Klampt not to find it. You could try setting HAVE_ROS=0 in the cmake definitions when compiling Klampt and then rebuild the python bindings cleanly. (I have no idea about the first error, though).

krishauser avatar Oct 02 '23 22:10 krishauser

Interesting, removing the ROS linking seems to have fixed both problems. Not sure as to the deeper cause, but should work for what we need out of IsaacGym. Should I document this somewhere or is it enough of an edge case to just leave here?

patricknaughton01 avatar Oct 03 '23 00:10 patricknaughton01