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

catkin install scripts with symlink

asked 2018-04-07 09:05:58 -0500

gustavogoretkin gravatar image

When a package has scripts (either in src/ or in scripts/) catkin_make install can copy those scripts into a install location so that they can be rosrun able. (This is done at the bottom of http://wiki.ros.org/rospy_tutorials/T... )

Is there an equivalent to python setup.py develop or pip install --editable that allows the original script to be edited and immediately run, without needing to do catkin_make install? This would require, for example, not copying the script but making a symlink.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-07 13:22:00 -0500

gvdhoorn gravatar image

updated 2018-04-08 03:21:13 -0500

This will sounds 'strange', but just don't run catkin_make install. Catkin only installs things when you ask it to. In a non-install run, it will compile things that need to be compiled (ie: C++, other languages), copy the output to the devel space, but Python modules and scripts are actually (almost) untouched.

It then places the path to the package containing the Python module(s) and script(s) in the src space on the PYTHONPATH and ROS_PACKAGE_PATH and after you source $CATKIN_WS/devel/setup.bash you should be able to run everything. The install space is actually not needed for that.

You end up with a situation that is analogous to setup.py develop (analogous, not identical): just edit the files in your srcspace and after having run catkin_make the first time, you don't need to do it again.

Unless you add or remove packages, or msg, service or action definitions, or any other part of packages that require code generation or building of some form.


Edit:

If I have a catkin_install_python, then I can rosrun mypkg myscript, otherwise myscript isn't available to rosrun.

I don't know about catkin_install_python, but rosrun will only show and start executable files. I've had this problem when forgetting to make my scripts executable.

edit flag offensive delete link more

Comments

Thanks for your answer. I suppose then I am missing something in CMakeLists.txt. If I have a catkin_install_python, then I can rosrun mypkg myscript, otherwise myscript isn't available to rosrun. Also I think I need catkin_make install for an unrelated reason.

gustavogoretkin gravatar image gustavogoretkin  ( 2018-04-07 16:12:03 -0500 )edit

If you must run catkin_make install, then you can't exploit the devel space as I wrote above unfortunately (or, not immediately: workspace overlaying could be used to work around this).

gvdhoorn gravatar image gvdhoorn  ( 2018-04-08 03:19:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-04-07 09:05:58 -0500

Seen: 1,627 times

Last updated: Apr 08 '18