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

catkin / setup.py installation into devel space not working

asked 2012-12-17 10:11:26 -0500

cdellin gravatar image

updated 2014-01-28 17:14:36 -0500

ngrennan gravatar image

Hey all,

I can't figure out how to correctly package a Python module so it shows up in my devel space after "catkin_make". I've tried every combination of setup.py and CMakeLists.txt that I can think of.

Let's say I have a ROS package called "my_package", and I'd like to have a Python module defined by "my_package.py" containing a function called "def myfunc()", so that from a different package, I could do "import my_package; my_package.myfunc()". After catkin_make, I expect things to be installed like this: devel/lib/python2.7/dist-packages/my_package.py. How do I write a CMakeLists.txt and setup.py for this package?

If this configuration is impossible, how do you recommend I structure a simple ROS package providing Python modules?

Thanks for your help!

Edit: I'm using Groovy.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
6

answered 2012-12-17 12:46:21 -0500

KruseT gravatar image

There is a tutorial on that here: http://www.ros.org/wiki/rospy_tutorials/Tutorials/Makefile (click catkin) Section 2.2

Also some more info here: http://ros.org/doc/groovy/api/catkin/html/user_guide/setup_dot_py.html

Note that catkin does not put your my_package.py in the devel space, it uses the one in your source space via some python voodoo, so in your devel space you will just get some __init__.py.

edit flag offensive delete link more

Comments

1

Thanks; this answered my question. It would be helpful if the __init__.py voodoo were documented somewhere (at least for people like me who are curious how the devel space works).

cdellin gravatar image cdellin  ( 2013-01-09 02:40:42 -0500 )edit

Question Tools

Stats

Asked: 2012-12-17 10:11:26 -0500

Seen: 6,547 times

Last updated: Dec 17 '12