Ask Your Question

several catkin workspaces

asked 2014-06-27 12:47:11 -0500

courrier gravatar image

Hi all,

Is it possible to have several catkin workspaces and to source them sequentially in the .bashrc without conflict or may we experience issues with that?

source /ws1/devel/setup.bash
source /ws2/devel/setup.bash
source /ws3/devel/setup.bash
# ...


edit retag flag offensive close merge delete



Effectively the last line will "overwrite" all previously sources workspaces. You should chain your workspaces on top of each other as described in the answer from @joq and only source the leaf workspace.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-06-28 17:50:36 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2014-09-17 04:29:22 -0500

courrier gravatar image

For people having packages coming from different git/subversion repositories with their own file hierarchy not catkin-compliant and wanted to create several catkin workspaces because of these, I suggest to create a unique "central" catkin workspaces with symbolic links pointing to your git/svn repos, by this way you don't break the file hierarchy of your repos.

courrier@zbook:~/ros_ws/src$ ls -l
total 29
lrwxrwxrwx 1 courrier courrier   42 Sep 16 12:22 baxter_common -> /home/courrier/packages_ros/src/baxter_common/
lrwxrwxrwx 1 courrier courrier   48 Sep  9 19:25 CMakeLists.txt -> /opt/ros/hydro/share/catkin/cmake/toplevel.cmake
lrwxrwxrwx 1 courrier courrier   47 Sep 10 15:02 lemon_moveit_config -> /home/courrier/inria/asv1/src/lemon_moveit_config/
lrwxrwxrwx 1 courrier courrier   26 Sep 11 13:34 lemon_ros -> /home/courrier/university/lemon_ros/
edit flag offensive delete link more

answered 2014-06-27 13:31:13 -0500

joq gravatar image

Problems are likely to arise. That approach is not recommended.

What should work reliably is to create

  • ws1 as an overlay of /opt/ros/hydro.setup.bash (for example)
  • ws2 as an overlay of ws1
  • ws3 as an overlay of ws2

Then, source /ws3/devel/setup.bash.

edit flag offensive delete link more


Oops. This might explain some problems I've been having. Thanks, ROS Answers!

Kurt Leucht gravatar image Kurt Leucht  ( 2014-07-03 16:22:19 -0500 )edit

I'm following the tutorial about how to create a proper overlay ( but I don't get it. What do they do different from me with my 3 "source"? I don't have this message "This workspace overlays blablabla" so I'm missing something but what?

courrier gravatar image courrier  ( 2014-07-23 07:18:54 -0500 )edit

I don't think the documentation is very clear about this. What I posted is the recommended solution. Maybe others can explain why.

joq gravatar image joq  ( 2014-07-23 08:47:24 -0500 )edit

That is what I wanted to do, but how do you create an overlay, then? I found out that tutorial above and... apparently what it does is only sourcing all setup.bash in the right order. Isn’t it what I was doing in my initial post?

courrier gravatar image courrier  ( 2014-07-23 09:20:51 -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



Asked: 2014-06-27 12:47:11 -0500

Seen: 5,803 times

Last updated: Sep 17 '14