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

How to use python files in src/package_name in nodes folder?

asked 2014-02-06 09:04:29 -0600

Vladimir gravatar image

I am writing a catkin project in python. I would like to put nodes in the "node" directory, and other source files in the src/package_name directory. However when I did that and tried to import a python module in the node file (located in the node folder) from the source directory I got an error saying the module didn't exist.

I couldn't find any tutorials on how to do this. Do I have to somehow tell catkin to export my src folder?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2014-02-06 09:10:08 -0600

updated 2014-02-06 09:12:48 -0600

You have to create, and then add the catkin_python_setup() function to your CMakeLists.txt. A good example package to follow is nmea_navsat_driver.

edit flag offensive delete link more


Dirk Thomas gravatar image Dirk Thomas  ( 2014-02-06 09:36:35 -0600 )edit

Exactly what I was looking for. Thanks!

Vladimir gravatar image Vladimir  ( 2014-02-06 09:46:28 -0600 )edit

Dirk— askbot mangles links which are the end of comments. You can add trailing punctuation to fix it, eg: .

mikepurvis gravatar image mikepurvis  ( 2014-02-07 08:10:10 -0600 )edit

Question Tools


Asked: 2014-02-06 09:04:29 -0600

Seen: 971 times

Last updated: Feb 06 '14