ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

catkin_make --pkg <package> alternative

asked 2018-09-06 09:15:31 -0500

reloaded gravatar image

Hello everybody,

I am using ROS kinetic and got an already finished ROS project build with catkin_make. My job is to add and edit some nodes in this project. The problem is, that I do not have the source files to every node (some of them are right protected, so the previous developer deleted the src folder of some nodes). If I put an CATKIN_IGNORE file in these node folders and then do catkin_make, they cannot be started after I restarted the PC.

So after some googling I found the option catkin_make --pkg <pkg>. And that has seem to be working good. But after a while it didn't just build the given pkg, it was just like the normal catkin_make and started to build all packages (which obviously failed, because of the missing src).

Is there a fix for this problem or another solution beside catkin_make --pkg for my problem?

Thanks for your help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-09-06 10:13:15 -0500

mgruhler gravatar image

First of all, it would be beneficial if you describe your layout in more detail.


I'm answering now on the following assumption:

     |-> build
     |-> devel
     |-> src
           |-> pkgA
                  |-> no src folder available
           |-> pkgB
                 |-> src (etc.) available

You got this workspace in a compiled state and you source ~/catkin_ws/devel/setup.bash to use it. pkgA is the one where the src has been deleted and thus cannot be compiled. The compiled binaries do reside in devel, though. You want to adapt pkgB.

Solution to your problem

The solution is actually pretty simple. Leave the ~/catkin_ws alone and use workspace chaining. In detail:

mkdir -p ~/my_catkin_ws/src                 # create a new workspace
source ~/catkin_ws/devel/setup.bash         # source the old one
cd ~/my_catkin_ws
catkin_make                                 # compile the new one
source ~/my_catkin_ws/devel/setup.bash      # now use the chained workspaces.

Then put a copy of pkgB (you do have the sources of this one) and any new packages you create into my_catkin_ws/src. Call catkin_make only in your new workspace. This allows you to use this pkgB and the pkgA of ~/catkin_ws.

What the other guy should have done

Don't pass around compiled workspaces, this makes no sense and is very error prone. You could, though install to a good place using catkin_make install (right install rules provided) and pass this directory around.

edit flag offensive delete link more


sorry for being imprecise, I'm new to ROS and don't know what is exactly needed. Your assumption was right, that is my layout. Thanks for the help and the quick answer, it worked fine for me.

reloaded gravatar image reloaded  ( 2018-09-07 06:42:57 -0500 )edit

happy to hear that!

mgruhler gravatar image mgruhler  ( 2018-09-07 06:43:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-09-06 09:15:31 -0500

Seen: 758 times

Last updated: Sep 06 '18