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

No module named '_tf' error when doing "writing a tf broadcaster (py) tutorial

asked 2016-12-09 00:13:51 -0500

Chamikajp gravatar image

updated 2016-12-09 07:38:59 -0500

Hi all Below is the error I'm getting when I try to launch the launch file using the command roslaunch learning_tf start_demo.launch

File "/home/cj/catkin_ws/src/learning_tf/nodes/turtle_tf_broadcaster.py", line 6, in <module> 
import tf
  File "/opt/ros/indigo/lib/python2.7/site-packages/tf/__init__.py", line 28, in <module>

    from _tf import *
ImportError: No module named '_tf' 

I tried updating using pacman -Syu and tried reinstalling the "tf" package but the result is the same.

I'm still a beginner and appreciate if someone can help me to correct this error.

PS.
I followed the steps given in this tutorial

This error occurs when I try to do the roslaunch learning_tf start_demo.launch step.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-12-09 01:59:23 -0500

mgruhler gravatar image

updated 2016-12-09 01:59:56 -0500

The problem is the leading underscore before tf in the import. Remove this and you should be good to go. But updating/reinstalling tf will not change this. The problem is in the learning_tf repo.

Where did you get this demo from? Did you clone from github or did you copy'n'paste stuff or did you change anything?

edit flag offensive delete link more

Comments

If it is this) demo, then I think it's a simple copy-paste error, as there is no underscore before tf in the example.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-09 05:02:59 -0500 )edit

Thank you very much for your replays.. This is the tutorial part I was following . The file in the learning_tf repo contains the import tf problem is with the __init__.py file..

Chamikajp gravatar image Chamikajp  ( 2016-12-09 06:43:20 -0500 )edit

It contains the from _tf import * .. I'll try editing the __init__.py file and get back to you..

Chamikajp gravatar image Chamikajp  ( 2016-12-09 06:43:33 -0500 )edit

But which "repo" are you talking about specifically?

gvdhoorn gravatar image gvdhoorn  ( 2016-12-09 07:04:09 -0500 )edit

Sorry if my comment is confusing. I meant the learning_tf folder which has the file containing the import tf code.. I exactly followed the steps given in the tutorial. Error is generated by this file /opt/ros/indigo/lib/python2.7/site-packages/tf/__init__.py"

Chamikajp gravatar image Chamikajp  ( 2016-12-09 07:38:57 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-09 00:13:51 -0500

Seen: 682 times

Last updated: Dec 09 '16