ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

tf2-ros for python3 ros meloic

asked 2022-04-18 21:41:52 -0600

distro gravatar image

Is there ros melodic tf2_ros library for python3 environment? RIght now when I try to import tf2_ros 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)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-04-18 23:46:06 -0600

Petros ADLATUS gravatar image

updated 2022-04-18 23:46:25 -0600

https://answers.ros.org/question/3262...

I think here is a solution for your problem

edit flag offensive delete link more

Comments

@ADLATUS that solution is for kinetic and not melodic

distro gravatar image distro  ( 2022-04-21 01:31:23 -0600 )edit

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

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-04-21 01:39:57 -0600 )edit

@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?

distro gravatar image distro  ( 2022-04-21 14:17:46 -0600 )edit

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

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-04-22 01:24:31 -0600 )edit
0

answered 2023-07-30 00:26:19 -0600

user1928 gravatar image
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-04-18 21:41:52 -0600

Seen: 2,439 times

Last updated: Jul 30 '23