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

avoiding having to call catkin_make for changes to python modules?

asked 2013-01-04 15:49:36 -0500

Advait Jain gravatar image

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

ngrennan gravatar image

While coding in Python (and using rosbuild) I find it very convenient to not to have to 'make' before testing my code:

e.g. I change a module (which lives in its own ROS package) that my Python script uses and without any 'make' I kill the script, run it again and have it use the updated module.

With catkin, am I correct in understanding that I will need to do a catkin_make each time so that the updated module gets copied into the devel space and is thus available to my script?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-01-04 22:14:36 -0500

tfoote gravatar image

No, you do not need to rerun catkin_make, make or anything else.

When working in devel space catkin does not copy your source. It provides a redirect from the devel space to your source space, using python import infrastructure. This means that any changes in your sources will be reflected in your next execution as if they were on your PYTHONPATH.

edit flag offensive delete link more

Comments

2

This however only work if you correctly use the setup.py and the cakin_python_setup script. And you may still need to rerun catkin_make after changes to your setup.py.

KruseT gravatar image KruseT  ( 2013-01-04 23:42:03 -0500 )edit

This however only work if you correctly use the setup.py and the cakin_python_setup script.

KruseT gravatar image KruseT  ( 2013-01-04 23:42:09 -0500 )edit

Thanks Tully and Thibault.

additional details: after adding a setup.py and adding catkin_python_setup() to CMakeLists, once we run catkin_make, it creates an __init__.py in <catkin_workspace>/devel/lib/python2.7/dist-package/<your_package>

This __init__.py redirects back to the source space.

Advait Jain gravatar image Advait Jain  ( 2013-01-06 12:09:50 -0500 )edit

Question Tools

Stats

Asked: 2013-01-04 15:49:36 -0500

Seen: 1,053 times

Last updated: Jan 04 '13