Robotics StackExchange | Archived questions

tf2-ros for python3 ros meloic

Is there ros melodic tf2ros library for python3 environment? RIght now when I try to import tf2ros for python3 environment I get

Traceback (most recent call last):
  File "/home/philip/server_prac/src/action_practice/src/tester.py", line 8, in <module>
    import tf2_ros
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
    from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)

Asked by distro on 2022-04-18 21:41:52 UTC

Comments

Answers

https://answers.ros.org/question/326226/importerror-dynamic-module-does-not-define-module-export-function-pyinit__tf2/

I think here is a solution for your problem

Asked by Petros ADLATUS on 2022-04-18 23:46:06 UTC

Comments

@ADLATUS that solution is for kinetic and not melodic

Asked by distro on 2022-04-21 01:31:23 UTC

The person, who answers mentioned that it's for Melodic. But it doesn't matter you can change commands with your

Asked by Petros ADLATUS on 2022-04-21 01:39:57 UTC

@petros ADLATUS I followed the instructions and got a folder in my workspace with tf2 files I think worl in python3, but I have no idea how to link code to use those folders instead of the default python 2.7 tf library. Would you know how to do that?

Asked by distro on 2022-04-21 14:17:46 UTC

maybe this can help you https://github.com/ros/geometry2/pull/173. Did you set the Python Path in the bashrc file?

Asked by Petros ADLATUS on 2022-04-22 01:24:31 UTC

It's here: http://wiki.ros.org/tf2_ros?distro=melodic

Asked by user1928 on 2023-07-30 00:26:19 UTC

Comments