0
$\begingroup$

Rosanswers logo

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?


Originally posted by Advait Jain on ROS Answers with karma: 140 on 2013-01-04

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by tfoote with karma: 58457 on 2013-01-04

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by KruseT on 2013-01-05:
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.

Comment by KruseT on 2013-01-05:
This however only work if you correctly use the setup.py and the cakin_python_setup script.

Comment by Advait Jain on 2013-01-06:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.