Error while importing tf2 ros packages

Hi Guys, whenever I import from tf.transformations import euler_from_quaternion I am getting the following error -

type or pastTraceback (most recent call last):
  File "/home/nilesh/isaac_sim/scripts/main/launcher.py", line 14, in <module>
    from sim_handler import *
  File "/home/nilesh/isaac_sim/scripts/main/sim_handler.py", line 35, in <module>
    from tf.transformations import euler_from_quaternion
  File "/home/nilesh/isaac_sim/ros_utils/devel/lib/python3/dist-packages/tf/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 30, in <module>
  File "/opt/ros/noetic/lib/python3/dist-packages/tf2_ros/__init__.py", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/noetic/lib/python3/dist-packages/tf2_py/__init__.py", line 38, in <module>
    from ._tf2 import *
ImportError: /opt/ros/noetic/lib/python3/dist-packages/tf2_py/_tf2.so: undefined symbol: _ZNK3tf210BufferCore12_frameExistsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
./python.sh: line 40: 85566 Segmentation fault      (core dumped) $python_exe "$@" $args
There was an error running python
e code here

Regards,
Nilesh

1 Like

From the trace, it looks you’re trying to load “tf.transformations” from Noetic. Perhaps Python is associating the wrong version of ROS when resolving packages. Have you checked your local installation of ROS in a Python interpreter separate from Isaac Sim just to make sure you’re able to pull in tf.transformations in a clean environment?

Hi, thanks for the reply. The import works in python interpreter separate from Isaac Sim.

1 Like