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

I am getting error when trying to import a python file from another Catkin Workspace.

asked 2014-09-12 02:59:23 -0500

ish45 gravatar image

updated 2014-09-12 03:00:34 -0500

Hi, All. I have a catkin workspace in eclipse and I am writing a Node. But, I need to import a python file from another catkin workspace which contains this file. But, when I try to import it, there is an error that there is no module named like that.

The exact error is like this -

File "src/Ish_odom_out_and_back.py", line 9, in <module> from rbx1_nav.transform_utils import quat_to_angle, normalize_angle ImportError: No module named rbx1_nav.transform_utils

For example,

My Catkin Workspace is like this - catkin_ws_ishan/src/ishan/ishan_nav/src/move.py. ishan_nav is the package name in my workspace.

The file that I want to import is in - catkin_ws/src/rbx1/rbx1_nav/src/rbx1_nav/transform_utils.py. Here, rbx1_nav is the package. The file That I want to import is transform_utils.py

So, How do I import transform_utils.py from my program in Eclipse which is in another catkin workspace????

Can anybody please help me.

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-09-12 05:54:18 -0500

joq gravatar image

You needed to source catkin_ws before you created catkin_ws_ishan, then source the dependent one.

edit flag offensive delete link more

Comments

So, Do I need to create the workspaces again?. Is there any other solution ??

ish45 gravatar image ish45  ( 2014-09-12 11:54:14 -0500 )edit

You can delete the build/ and devel/ subtrees, source the other workspace, and rerun catkin_make.

joq gravatar image joq  ( 2014-09-12 14:23:23 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-12 02:59:23 -0500

Seen: 668 times

Last updated: Sep 12 '14